Hi all,
Is there a better way of doing this, I googled it and found de IsNumeric, but it´s for VB and not recommended for C#.
Let me explain:
I have a string like "something123" and I need to get only the 123 value as a string from the string.
I coded the function above based on what I found at google, but is there a better and cleaner way to do that ?
private string getIntegersFromStr(string str)
{
int intOutVal;
string s;
string strToReturn = "";
foreach (char ch in str)
{
s = ch.ToString();
if (int.TryParse(s, out intOutVal))
{
//MessageBox.Show(ch.ToString());
strToReturn += s;
}
}
return strToReturn;
}
Thanks!