Here you can find the source of writeStringToFile(String str, String filePath)
public static void writeStringToFile(String str, String filePath)
//package com.java2s; //License from project: Open Source License import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; public class Main { public static void writeStringToFile(String str, String filePath) { File file = new File(filePath); try {//from w ww. ja va 2s .com BufferedWriter out = new BufferedWriter(new FileWriter(file, false)); out.write(str); out.close(); } catch (IOException e) { e.printStackTrace(); } } }