Menu
Question Index
...

Write a program to replace one character with another character.

Input (String, char, char) Output (String)
'HelloWorld', 'o', 'y' 'HellyWyrld'
JavaSchool', 'o', 'u' 'JavaSchuul'
'Concentrate', 'c', 'i' 'Conientrate'
'Mathematics', 't', 'g' 'Maghemagics'



class ModifyingString
{
    public static void main(String s[])
    {
        System.out.println("The resultant string is: " + getModifyiedString("HelloWorld", 'o', 'y'));

    }


    public static String getModifyiedString(String inputString, char originalCharacter, char replacementCharacter) {
    }

}

Doubts

Problems

Topic: replace() Method 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