Here you can find the source of writeStringToFile(String content, String fileName)
public static void writeStringToFile(String content, String fileName)
//package com.java2s; import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; public class Main { public static void writeStringToFile(String content, String fileName) { try {// w ww.j av a2s. c om BufferedWriter writer = new BufferedWriter(new FileWriter(fileName)); writer.write(content); writer.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }