/** @param args */ public static void main(String[] args) { TestString test = new TestString(); String str; // test.regTest(); // test.regTest2(); /*str = "\"rapport d\"\"infraction\""; test.csvDeleteQuota(str); str = "\"\"\"abc\"\"\""; test.csvDeleteQuota(str);*/ str = "rap'port d'infraction"; test.replaceSingleComma(str); String[] arr = {"a", "b"}; System.out.println(arr.toString()); }
public static void main(String[] args) { PrintStream consoleStream = System.out; ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); PrintStream stream = new PrintStream(outputStream); System.setOut(stream); testString.printSomething(); String result = outputStream.toString(); System.setOut(consoleStream); String stringBuilder = new String(result); String string = stringBuilder.replaceAll("te", "??"); System.out.println(string); }
public static void main(String[] args) throws IOException { PrintStream consoleStream = System.out; ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); PrintStream stream = new PrintStream(outputStream); System.setOut(stream); testString.printSomething(); String result = outputStream.toString(); System.setOut(consoleStream); BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String file = reader.readLine(); reader.close(); BufferedWriter bw = new BufferedWriter(new FileWriter(file)); bw.write(result); bw.close(); System.out.println(result); }
public static void main(String[] args) { PrintStream consoleStream = System.out; ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); PrintStream stream = new PrintStream(outputStream); System.setOut(stream); testString.printSomething(); String result = outputStream.toString(); System.setOut(consoleStream); String upperString = result.toUpperCase(); System.out.println(upperString); }
public static void main(String[] args) { PrintStream stream = System.out; ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); PrintStream printStream = new PrintStream(byteArrayOutputStream); System.setOut(printStream); testString.printSomething(); String rezult = byteArrayOutputStream.toString(); System.setOut(stream); rezult = rezult.replaceAll("te", "??"); System.out.println(rezult); }