Alex Rivera | Logout

Can i use regex to find the index of X?

Asked 2011-04-08T07:16:18.650
26

I have a big string, and want to find the first occurrence of X, X is "numberXnumber"... 3X3, or 4X9...

How could i do this in C#?

Edit
Report

1 Answer

7

Yes, regex could do that for you

you could do ([0-9]+)X([0-9]+) If you know that the numbers are only single digit you could take [0-9]X[0-9]

answered 2011-04-08T07:20:58.640

Your Answer