Java Text File Write writeString(String contents, File file)

Here you can find the source of writeString(String contents, File file)

Description

write String

License

Open Source License

Declaration

public static void writeString(String contents, File file) throws IOException 

Method Source Code

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

import java.io.File;

import java.io.FileWriter;
import java.io.IOException;

public class Main {
    public static void writeString(String contents, File file) throws IOException {
        FileWriter out = new FileWriter(file);
        try {/* ww w.j a  va  2s. c om*/
            out.write(contents);
        } finally {
            out.close();
        }
    }
}

Related

  1. writeString(final String data, final int length, final byte[] destination, int offset)
  2. writeString(final String output, final String fileName)
  3. writeString(final String s, final File f)
  4. writeString(String a, String MyFilePath)
  5. writeString(String content, String path, String charset)
  6. writeString(String contents, File file)
  7. writeString(String data, File file)
  8. writeString(String data, String file_path)
  9. writeString(String fileName, String str)