Menu
Question Index
...

Write a program to get the substring from the stringBuffer object by using subsequence method with the help of given range.

Input (StringBuffer, int, int) Output (String)
' Helloworld ', 2, 7 'Hello'
'Online School', 2, 6 'line'
'Concentrate', 3, 9 'centra'
'Computer', 3, 6 'put'



class GetSubSequenceOfStringBuffer
{
    public static void main(String s[])
    {
        StringBuffer stringBuffer = new StringBuffer("  Helloworld  ");
        System.out.println("SubString is: " + getSubSequence(stringBuffer, 2, 7));;

    }


    public static String getSubSequence(StringBuffer stringBuffer, int startIndex, int endIndex) {
    }

}

Doubts

Problems

Topic: Additional StringBuffer 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