17Jul/080
Convert a String to a Number String With Linq… YAY
- Sean
Really stupid little thing I came up with today... but I wanted to use Linq to strip any non number from a string and return the string with only numbers. I told you this was a stupid little thing.
public static String CreateNumberOnlyString(String textToCheck) { String returnText; var queryForIntegers = from currentChar in textToCheck where Char.IsNumber(currentChar) select currentChar; returnText = new String(queryForIntegers.ToArray()); return returnText; }


