Java Text File Write writeStringToFile(String string, File file)

Here you can find the source of writeStringToFile(String string, File file)

Description

write String To File

License

Open Source License

Declaration

public static void writeStringToFile(String string, File file) throws FileNotFoundException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.*;

public class Main {
    public static void writeStringToFile(String string, File file) throws FileNotFoundException {
        PrintWriter out = new PrintWriter(file);
        out.print(string);//  ww w  .  j  a  v a2 s  . c  om
        out.close();
    }
}

Related

  1. writeStringToFile(String string, File destFile)
  2. writeStringToFile(String string, File dstFile)
  3. writeStringToFile(String string, File file)
  4. writeStringToFile(String string, File file)
  5. writeStringToFile(String string, File file)
  6. writeStringToFile(String string, String fileName)
  7. writeStringToFile(String string, String fileName, boolean append)
  8. writeStringToFile(String string, String path)
  9. writeStringToFile(String stringContent, String fileName)