Menu
Question Index
...

Write a program to get the substring from the given StringBuffer according to the given index.
For more clarification see the requirements.

Input (StringBuffer, int) Output (String)
'HelloWorld', 5 'World'
'JavaSchool', 6 'hool'
'Mathematics', 7 'tics'
'Concentrate', 0 'Concentrate'



class GetSubStringFromStringBufferWithOnlyStartIndex
{
    public static void main(String s[])
    {
        System.out.println("The resultant substring is : " + getSubString(new StringBuffer("HelloWorld"), 5));

    }


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

}

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