string compare

  • Thread starter Thread starter Dino L.
  • Start date Start date
D

Dino L.

how can I know does some string contain some chars?

Now I use
Text1.StartsWith("nah")

I need something like SQL code "text1 like('%nah%')"
 
Dino L. said:
how can I know does some string contain some chars?

Now I use
Text1.StartsWith("nah")

I need something like SQL code "text1 like('%nah%')"

Have a look at the IndexOf() method in the String class.
 
Hi,

You can use IndexOf or LastIndexOf from String class

If it's a more complex expression you can use a regular expression, take a
look at Regex class and IsMatch method


Cheers,
 
Back
Top