Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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;
}
 
PREVIOUS NEXT
Tagged: #java #read #file #string
ADD COMMENT
Topic
Name
5+5 =