B4J Question String.Contains searches with wild card mask.

Msteffes

New Member
Brand new user of B4J so prepare for obvious questions/answer posts.

Is it possible to do a string search with a wild card mask within the function String.Contains. Or is there a better option.
I need to search strings similar to the following. "I see (10) dogs" but I want my function to ignore the (10); the number will vary from 0 to 255.
 

sorex

Expert
Licensed User
Longtime User
you can use regex to find a match based on wildcards.

B4X:
Dim m As Matcher
m=Regex.Matcher("I see \d+ dogs","what do I see here? I see 10 dogs in my living room")
If m.Find Then Log("string matched")
 
Last edited:
Upvote 0
Top