Return | Method | Summary |
---|---|---|
String | substring(int start) | Returns a new String that contains a subsequence of characters currently contained in this character sequence. |
String | substring(int start, int end) | Returns a new String that contains a subsequence of characters currently contained in this sequence. |
String | toString() | Returns a string representing the data in this sequence. |
CharSequence | subSequence(int start, int end) | Returns a new character sequence that is a subsequence of this sequence. |
public class Main {
public static void main(String[] argv) {
StringBuffer sb = new StringBuffer();
sb.append("java2s.com");
int index = sb.indexOf("com");
System.out.println(index);
}
}
The output:
7
java2s.com | Contact Us | Privacy Policy |
Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
All other trademarks are property of their respective owners. |