-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,800
  • 18
  • 27
HelloWorld1
  • 13,688
  • 28
  • 82
  • 145
  • 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
  • 180,369
  • 20
  • 160
  • 215
Threezool
  • 453
  • 4
  • 11