How do I split a string and look for digits?
<pre><code>String[] tokens = s.split(' ');
    for(int i = 0; i &lt; (tokens.length) - 1; ++i)
    {  
            if(isDigit(tokens[i]))
        {
            // Two numbers cannot be together without an operator.
            if(isDigit(tokens[i + 1]))
            {
                check = 1;
                break;
            }
            if((tokens[i + 1] == '(') )
            {
                check = 1;
                break;
            }
        }
           }
</code></pre>

<p>s is the string i'm splitting. after splitting i want to check whether each split part is a digit. i m not able to use isDigit because it can only be used on characters and here the split part is String.</p>

<p><strong>NOTE: i m writing a program for a calculator. if i use toCharArray() the more than one digit numbers will be split. eg. 23 will become 2 and 3 seperately.</strong> </p>
