Thursday 10 July 2014

substring (int start, int end)

public synchronized CharSequence subSequence(int start, int end)
Returns the substring begins at the specified start and extends to the character at index end – 1.

public class StringBufferSubString {
    public static void main(String args[]){
        StringBuffer s1 = new StringBuffer("Hello, How are you");
        System.out.println(s1.substring(7, s1.length()));
    }
}

Output
How are you


Prevoius                                                 Next                                                 Home

No comments:

Post a Comment