filterreader converts a string to uppercase java code example
Example: filterreader converts a string to uppercase java
import java.io.*;
public class TextFile {
public static void main (String[] args) throws IOException {
File file1 = new File("intext.txt");
File file2 = new File("outtext.txt");
char CharCounter = 0;
BufferedReader in = (new BufferedReader(newFileReader(file1)));
PrintWriter out = (new PrintWriter(new FileWriter(file2)));
int ch;
while ((ch = in.read()) != -1){
if (Character.isUpperCase(ch)){
Character.toLowerCase(ch);
}
out.write(ch);
}
in.close();
out.close();
}
}