1
Answer

Greetings :) Wildcard indexof ?

Andy Swchartzia

Andy Swchartzia

19y
5.4k
1
Hello there...Is it possible to use a wildcard character with the IndexOf() string function? In other words if I have the string "Bob is a useless person and is not cool" ...if I wanted to get the index of this and everything between Bob and cool could change...how could I use a wildcard character to do something like this? IndexOf("Bob*cool")? Please i'm DESPERATE and cannot find this answer anywhere! Thanks, Andy
Answers (1)
0
Solitaire

Solitaire

NA 77 0 19y

Seems to me you simply need the index of "Bob" under the condition that "cool" appears someplace after "Bob" within the same string.

You could get the index of "Bob" and "cool" separately.  Test if they both appear and if the index of "cool" is greater than the index of "Bob."  If true, then the index of "Bob" is your answer.