446 {
447 TStringArray allowedCharacters = {
".",
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9"};
448 for (
int i = 0; i < text.
Length(); i++)
449 {
450 int foundIndex = allowedCharacters.Find(text.
Get(i));
451 if (foundIndex == -1 || i == 0 && foundIndex == 0 || i == text.
Length() && foundIndex == 0)
452 return false;
453 }
454
456 return false;
457
458 return true;
459 }
array< string > TStringArray
proto native int Length()
Returns length of string.
proto string Get(int index)
Gets n-th character from string.
proto native float ToFloat()
Converts string to float.