Here you can find the source of writeStringToFile(File f, String s)
public static void writeStringToFile(File f, String s) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { public static void writeStringToFile(File f, String s) throws IOException { BufferedWriter writer = new BufferedWriter(new FileWriter(f)); writer.write(s);//from w ww. j ava 2 s . co m writer.close(); } }