Thursday, 10 July 2014

substring (int start)

public synchronized String substring(int start)
Returns a sub string like the substring begins at the specified index and extends to the end of this sequence.

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

Output
How are you


Prevoius                                                 Next                                                 Home

No comments:

Post a Comment