Answers for "convert file to string java"

1

java read file to string

public String readFile(String filePath) {
    String result = "";
    try {
        result = Files.readString(Paths.get(filePath));
    } catch (IOException e) {
        e.printStackTrace();
    }
    return result;
}
Posted by: Guest on June-06-2021
66

convert string to int java

String myString = "1234";
int foo = Integer.parseInt(myString);
Posted by: Guest on February-26-2020

Code answers related to "convert file to string java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language