Here you can find the source of writeStringToFile(String f, String s, boolean append)
Parameter | Description |
---|---|
f | - file to write to |
s | - string to write |
append | - append to end condition |
Parameter | Description |
---|---|
IOException | an exception |
public static void writeStringToFile(String f, String s, boolean append) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.FileWriter; import java.io.IOException; public class Main { /**/*from w w w. j a v a 2s.c o m*/ * Write a string to file - CSV Format * @param f - file to write to * @param s - string to write * @param append - append to end condition * @throws IOException */ public static void writeStringToFile(String f, String s, boolean append) throws IOException { try { String filename = f; FileWriter fw = new FileWriter(filename, append); fw.write(s); fw.write("\n"); fw.close(); } catch (IOException io) { System.err.println("IOException: " + io.getMessage()); } } }