public static String getToken(String s){
        int i = 0;
        StringBuilder sb = new StringBuilder();
        char c = s.charAt(i);
        
        if(c=='+' ||
           c=='-' ||
           c=='*' ||
           c=='/' ||
           c=='~'
          ) 
            sb.append(c);
        
        else if(Character.isDigit(c)) {
            while(Character.isDigit(c)){
                sb.append(c);
                c = s.charAt(++i);
            }
        } else {
        	sb.append(c);
        }
        
        return sb.toString();
    }