Hi everyone,
Actually, this is a very simple question. But I couldn't solve. So need your help.
I have a lot of strings like that: "2_4ad-6kss-2_5kk-3_40ppp"
Now I need to get this values from this string :
2_4
6
2_5
3_40
As you can see, everything a splitter except "_". I'm getting just numbers with Regex.
Like : 2, 4, 6, 2, 5, 3, 40
Do you have any suggestions have I can do it?
string Mystr= "2_4ad-6kss-2_5kk-3_40ppp";
string[] numbers= Regex.Split(Mystr, @"\D+");
Thank you.
What I have tried:
I tried Regex, Substring. Looking for a different way which I didn't know.