Java string和各種格式互轉 string轉int int轉string
簡單收集記錄下
其他類型轉String
String s = String.valueOf( value); // 其中 value 為任意一種數字類型。
字符串型轉換成各種數字類型:
String s = "169";
byte b = Byte.parseByte( s );
short t = Short.parseShort( s );
int i = Integer.parseInt( s );
long l = Long.parseLong( s );
Float f = Float.parseFloat( s );
Double d = Double.parseDouble( s );
