Menu
Question Index
...

Write a program to get the index with in the given sequence using of offsetBycodePoints.Sequence is nothing but range (start index + end index).

Input (StringBuffer, int, int) Output (int)
' Helloworld ', 2, 6 8
'Online School', 2, 1 3
'Mathematics', 5, 6 11
'7 Wonders', 1, 3 4



class GetIndexWithInGivenSequence
{
    public static void main(String s[])
    {
        StringBuffer stringBuffer = new StringBuffer("  Helloworld  ");
        System.out.println("Index is: " + getIndexOfSequence(stringBuffer, 2, 6));;

    }


    public static int getIndexOfSequence(StringBuffer input, int startIndex, int endIndex) {
    int index = -1;
    }

}

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