Determine if a string is numeric: Difference between revisions

→‎{{header|Java}}: ^ and $ not needed as matches() always matches whole string
(→‎{{header|Java}}: ^ and $ not needed as matches() always matches whole string)
Line 519:
 
<lang java>public static boolean isNumeric(String inputData) {
return inputData.matches("^[-+]?\\d+(\\.\\d+)?$");
}</lang>
 
Anonymous user