0
String manipulation programm ( string to float or string to integer conversion) can anyone pls help me with this
2 Respuestas
+ 4
Mahmoud 'Carbon' Saghraoui
Same as integer we can also parse string in float like that.
float val = Float.parseFloat(test):
+ 1
I'm not a Java Expert but i've found some interesting articles about your problem, string manipulation can be a bit complicated but still manageable.
To convert from string to float you can read the article below:
https://www.educba.com/java-string-to-float/.
But if you want to convert from string to integer then here:
Use 'Integer.parseInt'
String test = "200";
int i=Integer.parseInt(test);
This will convert test to an integer, which is 200.