STRING 2 INTEGER


try 
{    int a = Integer.parseInt(str);  } 
catch (NumberFormatException e)
 {    e.printStackTrace();   }

String str = “123”;

try
{ int b = Integer.valueOf(str).intValue() }
catch (NumberFormatException e)
{ e.printStackTrace();}


发布了28 篇原创文章 · 获赞 0 · 访问量 343

猜你喜欢

转载自blog.csdn.net/weixin_45003282/article/details/102641899