Here you can find the source of writeStringToFile(final String path, final String output)
Parameter | Description |
---|---|
path | A path to a file |
output | A text to write to a file |
public static void writeStringToFile(final String path, final String output)
//package com.java2s; //License from project: Open Source License import java.io.FileWriter; import java.io.IOException; public class Main { /**/*from www . j av a 2 s . c o m*/ * This method appends a string to a textfile * * @param path * A path to a file * @param output * A text to write to a file */ public static void writeStringToFile(final String path, final String output) { try { FileWriter fw = new FileWriter(path, false); fw.append(output); fw.close(); } catch (IOException e) { e.printStackTrace(); } } }