466 {
467 TStringArray allowedCharacters = {
".",
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9"};
468 for (
int i = 0; i < text.
Length(); i++)
469 {
470 int foundIndex = allowedCharacters.Find(text.
Get(i));
471 if (foundIndex == -1 || i == 0 && foundIndex == 0 || i == text.
Length() && foundIndex == 0)
472 return false;
473 }
474
476 return false;
477
478 return true;
479 }
class array< Class T > 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.