Jump to content

Determine if a string is numeric: Difference between revisions

Line 43:
==[[Java]]==
[[Category:Java]]
It's generally bad practice in Java to rely on an exception being thrown since exception handling is relatively expensive. If non-numeric strings are common, you're going to see a huge performance hit.
 
public boolean isNumeric(String input) {
try {
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.