My idea is something like this, but I don't know the correct code
if (mystring.matches("[0-9.]+")){ //do something here }else{ //do something here }
I think I'm almost there. The only problem is that there can be several decimal points in the string. I searched for this answer, but could not find.
java string decimal regex
user3320339
source share