I need to tokenise a string (split by space) to see if it ends in a number 
or a word. I'm using this hack to do it:
    public static boolean isNumeric(String str) {
        try {
            Double.parseDouble(str);
        } catch (NumberFormatException nfe) {
            return false;
        }
        return true;
    }

On the simulator and android this returns false with a string such as 
"Room" on iOS it returns true.

Any other way of detecting if it is a number that is consistent across 
platforms?

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/8c8fbbc0-d119-4dc6-b4c1-bafa8cd1ab5f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to