Java Write String to File writeFile(String filename, String content)

Here you can find the source of writeFile(String filename, String content)

Description

write File

License

Apache License

Declaration

public static void writeFile(String filename, String content) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.BufferedWriter;

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

import java.io.Writer;

public class Main {
    public static void writeFile(String filename, String content) {
        try {//from   ww w  .jav  a 2 s  .c  om
            Writer wrtiter = new FileWriter(filename);
            ;
            BufferedWriter bufferedWriter = new BufferedWriter(wrtiter);
            bufferedWriter.write(content);
            bufferedWriter.close();
        } catch (IOException e) {

        }
    }
}

Related

  1. writeFile(String filename, String content)
  2. writeFile(String filename, String content)
  3. WriteFile(String filename, String content)
  4. writeFile(String fileName, String content)
  5. writeFile(String filename, String content)
  6. writeFile(String fileName, String content, String encoding)
  7. writeFile(String filename, String contents)
  8. writeFile(String fileName, String contents)
  9. writeFile(String fileName, String contents)