Hi everyone
If i create a string object, how can i take the numerical value in this string object? Is there an easy method of string class?
For example:
For example:
String myString;
myString = "sth389";
int ab = myString.XXX ;
I want the value of "ab" to be 389 here.
Any suggestions?
Any suggestions?
Graham ShoreyPosted Dec 12, 2006, 4:14 AM
using System.Text.RegularExpressions;
int i = Convert.ToInt32(Regex.Replace("birseyler389", "[^0-9]", ""));