Get multiple numbers from a string
问题 I have strings like AS_!SD 2453iur ks@d9304-52kasd I need to get the 2 frist numbres of the string: for that case will be: 2453 and 9304 I don't have any delimiter in the string to try a split, and the length of the numbers and string is variable, I'm working in C# framework 4.0 in a WPF. thanks for the help, and sorry for my bad english 回答1: This solution will take two first numbers, each can have any number of digits string s = "AS_!SD 2453iur ks@d9304-52kasd"; MatchCollection matches =