Menu
Question Index
...

Write a program to replace one character sequence with another character sequence.

Input (String, CharacterSequence, CharacterSequence) Output (String)
'HelloWorld', 'World', 'MeritCampus' 'HelloMeritCampus'
JavaSchool', 'Java', 'Java Online ' 'Java Online School'
'MeritCampus', 'Campus', 'Students' 'MeritStudents'
'GoodBye', 'Bye', 'Knowledge' 'GoodKnowledge'



class ReplaceCharacterSequence
{
    public static void main(String s[])
    {
        CharSequence originalCharacterSequence = "World";
        CharSequence replacementCharacterSequence = "MeritCampus";
        System.out.println("The resultant string is: " + getResultantString("HelloWorld", originalCharacterSequence, replacementCharacterSequence));

    }


    public static String getResultantString(String inputString, CharSequence originalCharacterSequence, CharSequence replacementCharacterSequence) {
    }

}

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