My idea is something like this but I dont know the correct code
if (mystring.matches(\"[0-9.]+\")){ //do something here }else{ //do something here } <
if (mystring.matches(\"[0-9.]+\")){ //do something here }else{ //do something here }
Simplest
Example:
"123.45".split(".").length();