Menu
Question Index
...

Write a program to delete characters of stringbuffer using given range.

Input (StringBuffer, Integer, Integer) Output (String)
'Thomas Edison', 2, 4 'Thas Edison'
'ChandraBabu', 0, 7 'Babu'
'Kiran', 0, 1 'iran'



class DeleteCharactersOfStringBuffer
{
    public static void main(String s[])
    {
        StringBuffer stringBuffer = new StringBuffer("Thomas Edison");
        int range1 = 2;
        int range2 = 4;
        System.out.println("After deleting characters of StringBuffer object is : " + getResultantString(stringBuffer, range1, range2));

    }


    public static String getResultantString(StringBuffer input, int range1, int range2) {
    }

}

Doubts

Problems

Topic: Java delete() and deleteCharAt() Methods In StringBuffer

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App