Use
-
java.text.NumberFormat.parse
(java.lang.String)
public static void main(String[] args){
java.util.Locale loc = new Locale("ar", "AE");
String strShort = "125-";
try {
short data = java.text.NumberFormat.getNumberInstance(loc).parse(strShort).shortValue();
System.out.println(data);
} catch (Exception e) {
System.out.println(e.toString());
}
}
|
|