Hello!
Could anyone please tell me how to correctly use the function contains(s, search) if I want the exact match (i.e. if I want the function to check whether the entire substring "search" is exactly contained in the string "s" or not).
In other words, even if a part of the substring "search" is present in the string "s", the function returns "true". I rather want that the function should return "true" only if the entire substring exactly matches with some part (or whole) of string "s".
Thanks
Akhilesh
Query regarding the function contains(s, search)
Moderator: Martin
-
- Posts: 109
- Joined: 16 Apr 2014 04:57
Re: Query regarding the function contains(s, search)
You have a box full of toy cars. You search for one specific car and finally find it from the box. Did the box contain the car you were looking for, or did the entire contents of the box match the car you were looking for which would mean that there never were but that one specific car?
TLDR:
Above string contains the word "contains"...
..while above string does not. Sorry, I just love using similes. 
TLDR:
Code: Select all
This string contains a lot of words
Code: Select all
This string don't have that word
