I have a program that reads serial information from a device and it works fine, but I do something like that Want to If doing something (first character = R) (first character = T) do something else
I hope this makes sense. Actually I have only one way to find the first letter of one variable, then remove that character from the variable.
Thanks
Say we're talking about a string :
string input = GetInput (); String balance = input Asbestring (1); // Get the string without the first character switch (input [0]) {case 'R': {DoSomething (the rest); break; } Case 'T': {Dosoming Else (the rest); break; } // More case segments follow the default here: {break; }}
Comments
Post a Comment