How to check a string contains only digits and one occurrence of a decimal point?

后端 未结 8 1523
一向
一向 2021-02-15 14:37

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
}
<         


        
8条回答
提交回复
热议问题