I am having an string like this
string str = \"dfdsfdsf8fdfdfd9dfdfd4\"
I need to check whether the string contains number by looping through the array.
in C# 2.0, try this:
string str = "dfdsfdsf8fdfdfd9dfdfd4"; for (int i = 0; i < str.Length; i++) { int result; if (int.TryParse(str[i].ToString(), out result)) { //element is a number } else { // not a number } }