-3

If you have the three different wordd "candy3_ string box number", "ddcandy3_ string box number" and "ff candy3_ string box number" and you want to locate if the word "candy3_string" exist in the wordd.

How should I write the regex in c#?

Thanks!

user1666620
  • 4,700
  • 17
  • 27
HelloWorld1
  • 12,940
  • 25
  • 73
  • 128
  • do you want to see if the word exists or get it's position? And are you abolutely sure you want to use a regex? Is `"candy3_ string"` the same as `"candy3_string"`? – user1666620 Feb 24 '16 at 12:51

1 Answers1

2

To check if it exist use .Contains("candy3_string");

And to get it's position .IndexOf("candy3_string");

Dmitry Bychenko
  • 165,109
  • 17
  • 150
  • 199
Threezool
  • 455
  • 3
  • 11