Menu
Question Index
...

Given the word as a String, then write a program to prefix every character in the input string.

Input (String, char) Output (String)
Prabhas, K KPKrKaKbKhKaKs
Dhoni, E EDEhEoEnEi
Mother, O OMOoOtOhOeOr
Book, M MBMoMoMk
Welcome, R RWReRlRcRoRmRe



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

    }


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

}

Doubts

Problems

Topic: charAt() Method In Java - Java Character Extraction

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App