You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
388 B
23 lines
388 B
package kr.co.kihyun.lang; |
|
|
|
public class MNumber { |
|
|
|
public static boolean isNumber(String str) { |
|
try { |
|
Integer.parseInt(str); |
|
return true; |
|
} catch (NumberFormatException ex) { |
|
return false; |
|
} |
|
} |
|
|
|
public static boolean isNumber(char ch) { |
|
String num = "0123456789"; |
|
|
|
if (num.indexOf(Character.toString(ch)) > -1) { |
|
return true; |
|
} else { |
|
return false; |
|
} |
|
} |
|
}
|
|
|