I wish to split a string and assign its contents to other strings like so
string brick = "41 red"; ... //so the result will be string concatNum = "41"; string concatText = "red";
I read in the brick string one character at a time in a state machine. Is there an easy way to ask, in my if statement, if the character is a number, a letter, or something else?
A bit like…
if (extract == a number){ \\do stuff }
or
if (extract == a,z){\\do stuff }
…
I know I can do the following . . .
if (extract == "0" || extract != "1" || extract != "2" || extract != "3" || extract != "4" || extract != "5" || extract != "6" || extract != "7" || extract != "8" || extract != "9" ) || { //dostuff }
Obviously this a stupidly long winded way to do something but you will get what I need to do.
I have been researching but I am getting more confused.
I have seen the terms regular expressions and Linq mentioned so I was wondering what area I need to do my homework.
If anyone could point me in the right direction it would be appreciated