filterreader converts a string to uppercase java

Solutions on MaxInterview for filterreader converts a string to uppercase java by the best coders in the world

showing results for - "filterreader converts a string to uppercase java"
Virgil
28 Jun 2020
1import java.io.*;
2
3public class TextFile {
4    public static void main (String[] args) throws IOException {
5        File file1 = new File("intext.txt");
6        File file2 = new File("outtext.txt"); 
7        char CharCounter = 0;       
8        BufferedReader in = (new BufferedReader(newFileReader(file1)));
9        PrintWriter out = (new PrintWriter(new FileWriter(file2)));
10        int ch;
11        while ((ch = in.read()) != -1){
12            if (Character.isUpperCase(ch)){
13                Character.toLowerCase(ch);
14
15            }
16            out.write(ch);
17        }
18        in.close();
19        out.close();
20    }       
21}
similar questions