How can i convert a string to a abstract number, provided string is any valid number in java (say int, long, double etc).
I will not know the type of number in the string, so i can't use specific primitive parsing (like Integer.parseInt, Long.parseLong etc). Is there any generic way to convert it?
Eg:
- String -> Number
- "23423" -> 23423
- "34.3" -> 34.3
- "45364573747546" -> 45364573747546
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…