String/int转换

 

A.String to int

/*

* method 1

*/

int i = Integer.parseInt([String]);

//int i = Integer.parseInt([String], [int radix]);

/*

* method 2

*/

int i = Integer.valueOf([String]).intValue();

B.int to String

String s = String.valueOf([Integer]);

String s = Integer.toString([Integer]);

String s = “”+[Integer];

ps: Double, Folat, Long is as the same way

相关文章:

  • 2022-12-23
  • 2021-06-18
  • 2021-07-26
  • 2021-06-27
  • 2021-06-08
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-10
  • 2022-02-08
  • 2021-10-30
  • 2021-09-02
  • 2021-12-08
  • 2021-08-08
  • 2022-12-23
相关资源
相似解决方案