Regex.Matches return zero result
I'm pretty sure I'm doing something wrong here, but I can't point on the
problem.
I have this line in my C# code:
string match = "Test - Wow";
MatchCollection contact = Regex.Matches(match, "-");
//Expected output in contact : contact[0]=="Test " & contact[1]==" Wow" ;
But for some reason contact return empty, Meaning no match for "-". I even
tried @"-","(-)","(-)","[-]","([-])" but nothing works. What am I doing
wrong?
Thanks for your help in advance!
No comments:
Post a Comment