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.