Menu
Question Index
...

Given the input string, then write a program to prefix only the first occurrence of every character in the given input string. i.e. if the same character is repeated then only prefix for the first occurrence.

Input (String, Char) Output (String)
Coconut, T TCTocoTnTuTt
Dhoni, E EDEhEoEnEi
Potatoo, H HPHoHtHatoo
Tatoo, P PTPatPoo
Welcome, R RWReRlRcRoRme



class PrefixFirstOccurrenceOfEveryCharacter
{
    public static void main(String s[])
    {
        System.out.println("After prefixing : " + prefixEveryCharacter("Coconut", 'T'));

    }


    public static String prefixEveryCharacter(String word, char prefix) {
    }

}

Doubts

Problems

Topic: toLowerCase() And toUpperCase() Methods In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App