I have this textfield, which holds a number in ms. I want to make that clear, and add ms
into the textfield. If I try to add ms
and then parse it to an int, I get errors of course.
Does anybody know a workaround?
I have this textfield, which holds a number in ms. I want to make that clear, and add ms
into the textfield. If I try to add ms
and then parse it to an int, I get errors of course.
Does anybody know a workaround?
You could remove the ms before trying to parse the string:
int.TryParse(textFieldString.Replace("ms", ""), intVariable);
For that sort of thing you’d typically have the “ms” as a label outside the textfield.