Skip to content

Greetings :) Wildcard indexof ?

Andy Swchartzia

Asked Oct 23, 2005, 4:22 PM EDT1 answer
Share
LinkedInX
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

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0

    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.

    0