首页 > 编程语言 > 详细

Java string和各种格式互转 string转int int转string

时间:2019-10-30 15:34:22      阅读:75      评论:0      收藏:0      [点我收藏+]

其他类型转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 );

  

Java string和各种格式互转 string转int int转string

原文:https://www.cnblogs.com/hkgov/p/11765172.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!