String s="abcd efghc" All the examples below will use the the preceding definition of s string variable ################################# public int length() Returns the length of this string. Examples: System.out.println(s.lenght()) will print out 10. ################################### public char charAt(int index) Returns the char value at the specified index. An index ranges from 0 to length() - 1. The first char value of the sequence is at index 0, the next at index 1, and so on, as for array indexing. Examples: System.out.println(s.charAt(0)) will print out a. System.out.println(s.charAt(2)) will print out c. System.out.println(s.charAt(s.length()-1)) will print out h. Warning: IndexOutOfBoundsException - if the index argument is negative or not less than the length of this string. ################################### public String substring(int beginIndex) Returns a new string that is a substring of this string. The substring begins with the character at the specified index and extends to the end of this string. Examples: System.out.println(s.substring(2)) will print out "cd efghc" Parameters: beginIndex - the beginning index, inclusive. Warning: IndexOutOfBoundsException - if beginIndex is negative or larger than the length of this String object. ################################### public String substring(int beginIndex, int endIndex) Returns a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex - 1. Thus the length of the substring is endIndex-beginIndex. Examples: System.out.println(s.substring(2,3)) will print out "c" System.out.println(s.substring(2,4)) will print out "cd" Parameters: beginIndex - the beginning index, inclusive. endIndex - the ending index, exclusive. Warning: IndexOutOfBoundsException - if the beginIndex is negative, or endIndex is larger than the length of this String object, or beginIndex is larger than endIndex. ################################### public int indexOf(char c, int fromIndex) Returns the index within this string of the first occurrence of the specified character, starting the search at the specified index. If a character with value c occurs in the character sequence represented by this String object at an index no smaller than fromIndex, then the index of the first such occurrence is returned. There is no restriction on the value of fromIndex. If it is negative, it has the same effect as if it were zero: this entire string may be searched. If it is greater than the length of this string, it has the same effect as if it were equal to the length of this string: -1 is returned. Examples: System.out.println(s.indexOf('c',4)) will print out 9 Parameters: c - a character (Unicode code point). fromIndex - the index to start the search from. Returns: the index of the first occurrence of the character in the character sequence represented by this object that is greater than or equal to fromIndex, or -1 if the character does not occur. ################################### public static boolean isUpperCase(char ch) Determines if the specified character is an uppercase character. Examples: System.out.println(Character.isUpperCase('c')) will print out false System.out.println(Character.isUpperCase('A')) will print out true System.out.println(Character.isUpperCase(s.charAt(2))) will print out false Returns: true if the character is uppercase; false otherwise.