001 package other;
002
003 import java.io.File;
004 import java.io.FileWriter;
005 import java.io.IOException;
006 import java.io.PrintWriter;
007 import java.util.Iterator;
008
009 public class Util
010 {
011 public static void saveStringToFile(String s, String pathName) throws IOException
012 {
013 PrintWriter output = new PrintWriter(new FileWriter(new File(pathName)));
014 output.print(s);
015 output.close();
016 }
017
018 public static String merge(Iterator<String> i)
019 {
020 String s = "";
021 while (i.hasNext())
022 s += i.next() + "\n";
023 return s;
024 }
025
026 // public static String camelCase(String s)
027 // {
028 // StringBuffer ss = new StringBuffer("");
029 //
030 //// ss.append(s.substring(0, 1).toLowerCase())
031 //
032 //
033 // }
034
035 public static void main(String[] args)
036 {
037 // try
038 // {
039 // saveStringToFile("fooabc", "fooabc.txt");
040 // } catch (IOException e)
041 // {
042 // throw new RuntimeException(e);
043 // }
044 }
045
046
047 }