119    {
  120        TStringArray allowedCharacters = {
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9"};
 
  121        for (
int i = 0; i < text.
Length(); i++)
 
  122        {
  123            int foundIndex = allowedCharacters.Find(text.
Get(i));
 
  124            if (foundIndex == -1)
  125                return false;
  126            
  127            
  128            if (i > 0 && text.
ToInt() == 0)
 
  129            {
  130                return false;
  131            }
  132        }
  133        
  134        
  136        {
  137            return false;
  138        }
  139 
  140        return true;
  141    }
array< string > TStringArray
proto native int Length()
Returns length of string.
proto string Get(int index)
Gets n-th character from string.
proto native int ToInt()
Converts string to integer.