What\'s the easiest way to parse a string and extract a number and a letter? I have string that can be in the following format (number|letter or letter|number), i.e \"10A\",
char letter = str.Single(c => char.IsLetter(c)); int num = int.Parse(new string(str.Where(c => char.IsDigit(c)).ToArray()));
This solution is not terribly strict (it would allow things like "5A2" and return 'A' and 52) but it may be fine for your purposes.