Android 中 String与Int相互转化


String转化为Int等

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 );


Int转化为String

  int c = 123;
  String d = String.valueOf(c);



你可能感兴趣的:(c,android,String)