hidrau
asked on
searching a string in another string
Hello guys,
I have this string:
A := 'is / be / here / with / me /'
B := 'be / with / me / there'
in b, my frist word is be, the '/' is the delimiter to another word. I need to know if each word in my be is in A
the function must return me :
Total_in = 3
Total_out = 1 (there) this word is not in A
Total_missing = 2 (is / here) these words is missing in B
Thanks
I have this string:
A := 'is / be / here / with / me /'
B := 'be / with / me / there'
in b, my frist word is be, the '/' is the delimiter to another word. I need to know if each word in my be is in A
the function must return me :
Total_in = 3
Total_out = 1 (there) this word is not in A
Total_missing = 2 (is / here) these words is missing in B
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
guess I should explain the parameters :) they are siilar to russels parameters:
- first and second are the 2 strings
- i and o are in, and out. from your example i=3, o=1 for first case
- a and b return the "not in b" and "not in a" respectivly. (so they are inverse to what russel has) my logic was that a returns what remains in a, and b, what remains in b and the common things are deleted.
- first and second are the 2 strings
- i and o are in, and out. from your example i=3, o=1 for first case
- a and b return the "not in b" and "not in a" respectivly. (so they are inverse to what russel has) my logic was that a returns what remains in a, and b, what remains in b and the common things are deleted.
ASKER
Two way of doing the same task - both very interesting.
Thanks guys
Thanks guys
ASKER
A := 'is / be / is / here'
if b only has one 'is', then it is missing another is.
I need a another string with the words missing in B