Here you can find the source of writeStringToFile(File file, String s)
public static void writeStringToFile(File file, String s) throws IOException
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintStream; public class Main { public static void writeStringToFile(File file, String s) throws IOException { try (PrintStream out = new PrintStream(new FileOutputStream(file, false))) { out.print(s);//w w w. ja va2 s. com } } }