jeudi 15 octobre 2020

Java program asking the user to input any string and will process the following options

There is a problem with the number 5

Use a predefined functions. 1. count number of characters 2. count number of words 3. search a substring 4. replace a character 5. deleting the word 6. insertion of a word 7. Exit

            String word = in.nextLine();
            System.out.println("Word to be delete: ");
            word = in.nextLine();
            String rs=in.nextLine();
            if (name.word(rs) != null) {
                name = name.replaceAll(word, "");
                System.out.println("Result: " + name);
            } else {
                System.out.println(word + " not found");
            }
            break;```
        

**There is an error on my number 5**

Aucun commentaire:

Enregistrer un commentaire