Monday 12 December 2011

string manipulation in java example - Other Methods for Manipulating Strings for Selenium


Here are several other String methods for manipulating strings:
Other Methods in the String Class for Manipulating Strings
MethodDescription
String[] split(String regex)
String[] split(String regex, int limit)
Searches for a match as specified by the string argument (which contains a regular expression) and splits this string into an array of strings accordingly. The optional integer argument specifies the maximum size of the returned array. Regular expressions are covered in the lesson titled "Regular Expressions."
CharSequence subSequence(int beginIndex, int endIndex)Returns a new character sequence constructed from beginIndex index up untilendIndex - 1.
String trim()Returns a copy of this string with leading and trailing white space removed.
String toLowerCase()
String toUpperCase()
Returns a copy of this string converted to lowercase or uppercase. If no conversions are necessary, these methods return the original string.