如何字符串转换为长字符串、转换为

2023-09-04 09:54:33 作者:有杀气的萝莉

你如何转换一个字符串转换为长。

对于int你

  INT I = 3423;
字符串str;
海峡= str.valueOf(ⅰ);
 

你怎么这么走另一条路,但长。

 长LG;
字符串str =1333073704000
LG = lg.valueOf(STR);
 

解决方案 oracle 怎么把字符串转换成日期

这是做一个常见的​​方式:

 长L =的Long.parseLong(STR);
 

还有这个方法: Long.valueOf(STR); 不同的是, parseLong 返回原始,而的valueOf 返回新龙()对象。

how do you convert a string into a long.

for int you

int i = 3423;
String str;
str = str.valueOf(i);

so how do you go the other way but with long.

long lg;
String Str = "1333073704000"
lg = lg.valueOf(Str);

解决方案

This is a common way to do it:

long l = Long.parseLong(str);

There is also this method: Long.valueOf(str); Difference is that parseLong returns a primitive long while valueOf returns a new Long() object.

 
精彩推荐
图片推荐