java convert string to float without knowing if it is valid code example
Example 1: convert string to float java
String yourString = "23.7";
float yourFloat = Float.parseFloat(yourString);
Example 2: java string to float
Float myFloat = Float.parseFloat("23.5")