Liferay 6.1.2-ce-ga3

com.liferay.portal.kernel.util
Class StringUtil

java.lang.Object
  extended by com.liferay.portal.kernel.util.StringUtil

public class StringUtil
extends Object

The String utility class.


Constructor Summary
StringUtil()
           
 
Method Summary
static String add(String s, String add)
          Adds string add to string s resulting in a comma delimited list of strings, disallowing duplicate strings in the list.
static String add(String s, String add, String delimiter)
          Adds string add to string s that represents a delimited list of strings, using a specified delimiter and disallowing duplicate words.
static String add(String s, String add, String delimiter, boolean allowDuplicates)
          Adds string add to string s that represents a delimited list of strings, using a specified delimiter and optionally allowing duplicate words.
static String appendParentheticalSuffix(String s, int suffix)
          Returns the original string with an appended space followed by the string value of the suffix surrounded by parentheses.
static String appendParentheticalSuffix(String s, String suffix)
          Returns the original string with an appended space followed by the suffix surrounded by parentheses.
static String bytesToHexString(byte[] bytes)
          Converts an array of bytes to a string representing the bytes in hexadecimal form.
static boolean contains(String s, String text)
          Returns true if the string contains the text as a comma delimited list entry.
static boolean contains(String s, String text, String delimiter)
          Returns true if the string contains the text as a delimited list entry.
static int count(String s, String text)
          Returns the number of times the text appears in the string.
static boolean endsWith(String s, char end)
          Returns true if the string ends with the specified character.
static boolean endsWith(String s, String end)
          Returns true if the string ends with the string end.
static String extract(String s, char[] chars)
          Returns the substring of each character instance in string s that is found in the character array chars.
static String extractChars(String s)
          Returns the substring of English characters from the string.
static String extractDigits(String s)
          Returns a string consisting of all of the digits extracted from the string.
static String extractFirst(String s, char delimiter)
          Returns the substring of s up to but not including the first occurrence of the delimiter.
static String extractFirst(String s, String delimiter)
          Returns the substring of s up to but not including the first occurrence of the delimiter.
static String extractLast(String s, char delimiter)
          Returns the substring of s after but not including the last occurrence of the delimiter.
static String extractLast(String s, String delimiter)
          Returns the substring of s after but not including the last occurrence of the delimiter.
static String extractLeadingDigits(String s)
           
static String highlight(String s, String keywords)
          Deprecated.  
static String highlight(String s, String[] queryTerms)
           
static String highlight(String s, String[] queryTerms, String highlight1, String highlight2)
           
static String highlight(String s, String keywords, String highlight1, String highlight2)
          Deprecated.  
static String insert(String s, String insert, int offset)
          Inserts one string into the other at the specified offset index.
static void lowerCase(String... array)
           
static String lowerCase(String s)
          Converts all of the characters in the string to lower case.
static boolean matches(String s, String pattern)
          Returns true if the specified pattern occurs at any position in the string.
static boolean matchesIgnoreCase(String s, String pattern)
          Returns true if the specified pattern occurs at any position in the string, ignoring case.
static String merge(boolean[] array)
          Merges the elements of the boolean array into a string representing a comma delimited list of its values.
static String merge(boolean[] array, String delimiter)
          Merges the elements of the boolean array into a string representing a delimited list of its values.
static String merge(char[] array)
          Merges the elements of the character array into a string representing a comma delimited list of its values.
static String merge(char[] array, String delimiter)
          Merges the elements of the character array into a string representing a delimited list of its values.
static String merge(Collection<?> col)
           
static String merge(Collection<?> col, String delimiter)
           
static String merge(double[] array)
          Merges the elements of an array of double-precision decimal numbers by returning a string representing a comma delimited list of its values.
static String merge(double[] array, String delimiter)
          Merges the elements of an array of double-precision decimal numbers by returning a string representing a delimited list of its values.
static String merge(float[] array)
          Merges the elements of an array of decimal numbers into a string representing a comma delimited list of its values.
static String merge(float[] array, String delimiter)
          Merges the elements of an array of decimal numbers into a string representing a delimited list of its values.
static String merge(int[] array)
          Merges the elements of an array of integers into a string representing a comma delimited list of its values.
static String merge(int[] array, String delimiter)
          Merges the elements of an array of integers into a string representing a delimited list of its values.
static String merge(long[] array)
          Merges the elements of an array of long integers by returning a string representing a comma delimited list of its values.
static String merge(long[] array, String delimiter)
          Merges the elements of an array of long integers by returning a string representing a delimited list of its values.
static String merge(Object[] array)
          Merges the elements of an array of objects into a string representing a comma delimited list of the objects.
static String merge(Object[] array, String delimiter)
          Merges the elements of an array of objects into a string representing a delimited list of the objects.
static String merge(short[] array)
          Merges the elements of an array of short integers by returning a string representing a comma delimited list of its values.
static String merge(short[] array, String delimiter)
          Merges the elements of an array of short integers by returning a string representing a delimited list of its values.
static String quote(String s)
          Returns the string enclosed by apostrophes.
static String quote(String s, char quote)
          Returns the string enclosed by the quote character.
static String quote(String s, String quote)
          Returns the string enclosed by the quote strings.
static String randomize(String s)
          Pseudorandomly permutes the characters of the string.
static String read(ClassLoader classLoader, String name)
           
static String read(ClassLoader classLoader, String name, boolean all)
           
static String read(InputStream is)
           
static void readLines(InputStream is, Collection<String> lines)
           
static String remove(String s, String remove)
          Removes the remove string from string s that represents a list of comma delimited strings.
static String remove(String s, String remove, String delimiter)
          Removes the remove string from string s that represents a list of delimited strings.
static String replace(String s, char oldSub, char newSub)
          Replaces all occurrences of the character with the new character.
static String replace(String s, char oldSub, String newSub)
          Replaces all occurrences of the character with the new string.
static String replace(String s, String[] oldSubs, String[] newSubs)
          Replaces all occurrences of the elements of the string array with the corresponding elements of the new string array.
static String replace(String s, String[] oldSubs, String[] newSubs, boolean exactMatch)
          Replaces all occurrences of the elements of the string array with the corresponding elements of the new string array, optionally replacing only substrings that are surrounded by word boundaries.
static String replace(String s, String oldSub, String newSub)
          Replaces all occurrences of the string with the new string.
static String replace(String s, String oldSub, String newSub, int fromIndex)
          Replaces all occurrences of the string with the new string, starting from the specified index.
static String replace(String s, String begin, String end, Map<String,String> values)
           
static String replaceFirst(String s, char oldSub, char newSub)
          Replaces the first occurrence of the character with the new character.
static String replaceFirst(String s, char oldSub, String newSub)
          Replaces the first occurrence of the character with the new string.
static String replaceFirst(String s, String[] oldSubs, String[] newSubs)
          Replaces the first occurrences of the elements of the string array with the corresponding elements of the new string array.
static String replaceFirst(String s, String oldSub, String newSub)
          Replaces the first occurrence of the string with the new string.
static String replaceLast(String s, char oldSub, char newSub)
          Replaces the last occurrence of the character with the new character.
static String replaceLast(String s, char oldSub, String newSub)
          Replaces the last occurrence of the character with the new string.
static String replaceLast(String s, String[] oldSubs, String[] newSubs)
          Replaces the last occurrences of the elements of the string array with the corresponding elements of the new string array.
static String replaceLast(String s, String oldSub, String newSub)
          Replaces the last occurrence of the string oldSub in the string s with the string newSub.
static StringBundler replaceToStringBundler(String s, String begin, String end, Map<String,String> values)
           
static StringBundler replaceWithStringBundler(String s, String begin, String end, Map<String,StringBundler> values)
           
static String reverse(String s)
          Reverses the order of the characters of the string.
static String safePath(String path)
          Replaces all double slashes of the string with single slashes.
static String shorten(String s)
          Returns a string representing the original string appended with suffix "..." and then shortened to 20 characters.
static String shorten(String s, int length)
          Returns a string representing the original string appended with suffix "..." and then shortened to the specified length.
static String shorten(String s, int length, String suffix)
          Returns a string representing the original string appended with the specified suffix and then shortened to the specified length.
static String shorten(String s, String suffix)
          Returns a string representing the original string appended with the specified suffix and then shortened to 20 characters.
static String[] split(String s)
          Splits string s around comma characters.
static boolean[] split(String s, boolean x)
          Splits the string s around comma characters returning the boolean values of the substrings.
static String[] split(String s, char delimiter)
          Splits the string s around the specified delimiter.
static double[] split(String s, double x)
          Splits the string s around comma characters returning the double-precision decimal values of the substrings.
static float[] split(String s, float x)
          Splits the string s around comma characters returning the decimal values of the substrings.
static int[] split(String s, int x)
          Splits the string s around comma characters returning the integer values of the substrings.
static long[] split(String s, long x)
          Splits the string s around comma characters returning the long integer values of the substrings.
static short[] split(String s, short x)
          Splits the string s around comma characters returning the short integer values of the substrings.
static String[] split(String s, String delimiter)
          Splits the string s around the specified delimiter string.
static boolean[] split(String s, String delimiter, boolean x)
          Splits the string s around the specified delimiter returning the boolean values of the substrings.
static double[] split(String s, String delimiter, double x)
          Splits the string s around the specified delimiter returning the double-precision decimal values of the substrings.
static float[] split(String s, String delimiter, float x)
          Splits the string s around the specified delimiter returning the decimal values of the substrings.
static int[] split(String s, String delimiter, int x)
          Splits the string s around the specified delimiter returning the integer values of the substrings.
static long[] split(String s, String delimiter, long x)
          Splits the string s around the specified delimiter returning the long integer values of the substrings.
static short[] split(String s, String delimiter, short x)
          Splits the string s around the specified delimiter returning the short integer values of the substrings.
static String[] splitLines(String s)
          Splits string s around return and newline characters.
static boolean startsWith(String s, char begin)
          Returns true if, ignoring case, the string starts with the specified character.
static boolean startsWith(String s, String start)
          Returns true if, ignoring case, the string starts with the specified start string.
static int startsWithWeight(String s1, String s2)
          Returns the number of starting characters that s1 and s2 have in common before their characters deviate.
static String strip(String s, char remove)
          Returns a string representing the string s with all occurrences of the specified character removed.
static String stripBetween(String s, String begin, String end)
          Returns a string representing the combination of the substring of s up to but not including the string begin concatenated with the substring of s after but not including the string end.
static String toCharCode(String s)
          Returns a string representing the Unicode character codes of the characters comprising the string s.
static String toHexString(int i)
           
static String toHexString(long l)
           
static String toHexString(Object obj)
           
static String trim(String s)
          Trims all leading and trailing whitespace from the string.
static String trim(String s, char c)
          Trims leading and trailing whitespace from the string, up to but not including the whitespace character specified by c.
static String trim(String s, char[] exceptions)
          Trims leading and trailing whitespace from the string, up to but not including the whitespace characters specified by exceptions.
static String trimLeading(String s)
          Trims all leading whitespace from the string.
static String trimLeading(String s, char c)
          Trims leading whitespace from the string, up to but not including the whitespace character specified by c.
static String trimLeading(String s, char[] exceptions)
          Trims leading whitespace from the string, up to but not including the whitespace characters specified by exceptions.
static String trimTrailing(String s)
          Trims all trailing whitespace from the string.
static String trimTrailing(String s, char c)
          Trims trailing whitespace from the string, up to but not including the whitespace character specified by c.
static String trimTrailing(String s, char[] exceptions)
          Trims trailing whitespace from the string, up to but not including the whitespace characters specified by exceptions.
static String unquote(String s)
          Removes leading and trailing double and single quotation marks from the string.
static String upperCase(String s)
          Converts all of the characters in the string to upper case.
static String upperCaseFirstLetter(String s)
          Converts the first character of the string to upper case.
static String valueOf(Object obj)
          Returns the string value of the object.
static String wrap(String text)
           
static String wrap(String text, int width, String lineSeparator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtil

public StringUtil()
Method Detail

add

public static String add(String s,
                         String add)
Adds string add to string s resulting in a comma delimited list of strings, disallowing duplicate strings in the list.

The resulting string ends with a comma even if the original string does not.

Parameters:
s - the original string, representing a comma delimited list of strings
add - the string to add to the original, representing the string to add to the list
Returns:
a string that represents the original string and the added string separated by a comma, or null if the string to add is null

add

public static String add(String s,
                         String add,
                         String delimiter)
Adds string add to string s that represents a delimited list of strings, using a specified delimiter and disallowing duplicate words.

The returned string ends with the delimiter even if the original string does not.

Parameters:
s - the original string, representing a delimited list of strings
add - the string to add to the original, representing the string to add to the list
delimiter - the delimiter used to separate strings in the list
Returns:
a string that represents the original string and the added string separated by the delimiter, or null if the string to add or the delimiter string is null

add

public static String add(String s,
                         String add,
                         String delimiter,
                         boolean allowDuplicates)
Adds string add to string s that represents a delimited list of strings, using a specified delimiter and optionally allowing duplicate words.

The returned string ends with the delimiter even if the original string does not.

Parameters:
s - the original string, representing a delimited list of strings
add - the string to add to the original, representing the string to add to the list
delimiter - the delimiter used to separate strings in the list
allowDuplicates - whether to allow duplicate strings
Returns:
a string that represents the original string and the added string separated by the delimiter, or null if the string to add or the delimiter string is null

appendParentheticalSuffix

public static String appendParentheticalSuffix(String s,
                                               int suffix)
Returns the original string with an appended space followed by the string value of the suffix surrounded by parentheses.

If the original string ends with a numerical parenthetical suffix having an integer value equal to suffix - 1, then the existing parenthetical suffix is replaced by the new one.

Examples:

 
 appendParentheticalSuffix("file", 0) returns "file (0)"
 appendParentheticalSuffix("file (0)", 0) returns "file (0) (0)"
 appendParentheticalSuffix("file (0)", 1) returns "file (1)"
 appendParentheticalSuffix("file (0)", 2) returns "file (0) (2)"
 
 

Parameters:
s - the original string
suffix - the suffix to be appended
Returns:
the resultant string whose characters equal those of the original string, followed by a space, followed by the specified suffix enclosed in parentheses, or, if the difference between the provided suffix and the existing suffix is 1, the existing suffix is incremented by 1

appendParentheticalSuffix

public static String appendParentheticalSuffix(String s,
                                               String suffix)
Returns the original string with an appended space followed by the suffix surrounded by parentheses.

Example:

 
 appendParentheticalSuffix("Java", "EE") returns "Java (EE)"
 
 

Parameters:
s - the original string
suffix - the suffix to be appended
Returns:
a string that represents the original string, followed by a space, followed by the suffix enclosed in parentheses

bytesToHexString

public static String bytesToHexString(byte[] bytes)
Converts an array of bytes to a string representing the bytes in hexadecimal form.

Parameters:
bytes - the array of bytes to be converted
Returns:
the string representing the bytes in hexadecimal form

contains

public static boolean contains(String s,
                               String text)
Returns true if the string contains the text as a comma delimited list entry.

Example:

 
 contains("one,two,three", "two") returns true
 contains("one,two,three", "thr") returns false
 
 

Parameters:
s - the string in which to search
text - the text to search for in the string
Returns:
true if the string contains the text as a comma delimited list entry; false otherwise

contains

public static boolean contains(String s,
                               String text,
                               String delimiter)
Returns true if the string contains the text as a delimited list entry.

Examples:

 
 contains("three...two...one", "two", "...") returns true
 contains("three...two...one", "thr", "...") returns false
 
 

Parameters:
s - the string in which to search
text - the text to search for in the string
delimiter - the delimiter
Returns:
true if the string contains the text as a delimited list entry; false otherwise

count

public static int count(String s,
                        String text)
Returns the number of times the text appears in the string.

Parameters:
s - the string in which to search
text - the text to search for in the string
Returns:
the number of times the text appears in the string

endsWith

public static boolean endsWith(String s,
                               char end)
Returns true if the string ends with the specified character.

Parameters:
s - the string in which to search
end - the character to search for at the end of the string
Returns:
true if the string ends with the specified character; false otherwise

endsWith

public static boolean endsWith(String s,
                               String end)
Returns true if the string ends with the string end.

Parameters:
s - the string in which to search
end - the string to check for at the end of the string
Returns:
true if the string ends with the string end; false otherwise

extract

public static String extract(String s,
                             char[] chars)
Returns the substring of each character instance in string s that is found in the character array chars. The substring of characters returned maintain their original order.

Parameters:
s - the string from which to extract characters
chars - the characters to extract from the string
Returns:
the substring of each character instance in string s that is found in the character array chars, or an empty string if the given string is null

extractChars

public static String extractChars(String s)
Returns the substring of English characters from the string.

Parameters:
s - the string from which to extract characters
Returns:
the substring of English characters from the string, or an empty string if the given string is null

extractDigits

public static String extractDigits(String s)
Returns a string consisting of all of the digits extracted from the string.

Parameters:
s - the string from which to extract digits
Returns:
a string consisting of all of the digits extracted from the string

extractFirst

public static String extractFirst(String s,
                                  char delimiter)
Returns the substring of s up to but not including the first occurrence of the delimiter.

Parameters:
s - the string from which to extract a substring
delimiter - the character whose index in the string marks where to end the substring
Returns:
the substring of s up to but not including the first occurrence of the delimiter, null if the string is null or the delimiter does not occur in the string

extractFirst

public static String extractFirst(String s,
                                  String delimiter)
Returns the substring of s up to but not including the first occurrence of the delimiter.

Parameters:
s - the string from which to extract a substring
delimiter - the smaller string whose index in the larger string marks where to end the substring
Returns:
the substring of s up to but not including the first occurrence of the delimiter, null if the string is null or the delimiter does not occur in the string

extractLast

public static String extractLast(String s,
                                 char delimiter)
Returns the substring of s after but not including the last occurrence of the delimiter.

Parameters:
s - the string from which to extract the substring
delimiter - the character whose last index in the string marks where to begin the substring
Returns:
the substring of s after but not including the last occurrence of the delimiter, null if the string is null or the delimiter does not occur in the string

extractLast

public static String extractLast(String s,
                                 String delimiter)
Returns the substring of s after but not including the last occurrence of the delimiter.

Parameters:
s - the string from which to extract the substring
delimiter - the string whose last index in the string marks where to begin the substring
Returns:
the substring of s after but not including the last occurrence of the delimiter, null if the string is null or the delimiter does not occur in the string

extractLeadingDigits

public static String extractLeadingDigits(String s)

highlight

public static String highlight(String s,
                               String keywords)
Deprecated. 


highlight

public static String highlight(String s,
                               String keywords,
                               String highlight1,
                               String highlight2)
Deprecated. 


highlight

public static String highlight(String s,
                               String[] queryTerms)

highlight

public static String highlight(String s,
                               String[] queryTerms,
                               String highlight1,
                               String highlight2)

insert

public static String insert(String s,
                            String insert,
                            int offset)
Inserts one string into the other at the specified offset index.

Parameters:
s - the original string
insert - the string to be inserted into the original string
offset - the index of the original string where the insertion should take place
Returns:
a string representing the original string with the other string inserted at the specified offset index, or null if the original string is null

lowerCase

public static String lowerCase(String s)
Converts all of the characters in the string to lower case.

Parameters:
s - the string to convert
Returns:
the string, converted to lowercase, or null if the string is null
See Also:
String#toLowerCase()}

lowerCase

public static void lowerCase(String... array)

matches

public static boolean matches(String s,
                              String pattern)
Returns true if the specified pattern occurs at any position in the string.

Parameters:
s - the string
pattern - the pattern to search for in the string
Returns:
true if the specified pattern occurs at any position in the string

matchesIgnoreCase

public static boolean matchesIgnoreCase(String s,
                                        String pattern)
Returns true if the specified pattern occurs at any position in the string, ignoring case.

Parameters:
s - the string
pattern - the pattern to search for in the string
Returns:
true if the specified pattern occurs at any position in the string

merge

public static String merge(boolean[] array)
Merges the elements of the boolean array into a string representing a comma delimited list of its values.

Parameters:
array - the boolean values to merge
Returns:
a string representing a comma delimited list of the values of the boolean array, an empty string if the array is empty, or null if the array is null

merge

public static String merge(boolean[] array,
                           String delimiter)
Merges the elements of the boolean array into a string representing a delimited list of its values.

Parameters:
array - the boolean values to merge
delimiter - the delimiter
Returns:
a string representing a comma delimited list of the values of the boolean array, an empty string if the array is empty, or null if the array is null

merge

public static String merge(char[] array)
Merges the elements of the character array into a string representing a comma delimited list of its values.

Parameters:
array - the characters to merge
Returns:
a string representing a comma delimited list of the values of the character array, an empty string if the array is empty, or null if the array is null

merge

public static String merge(char[] array,
                           String delimiter)
Merges the elements of the character array into a string representing a delimited list of its values.

Parameters:
array - the characters to merge
delimiter - the delimiter
Returns:
a string representing a delimited list of the values of the character array, an empty string if the array is empty, or null if the array is null

merge

public static String merge(Collection<?> col)

merge

public static String merge(Collection<?> col,
                           String delimiter)

merge

public static String merge(double[] array)
Merges the elements of an array of double-precision decimal numbers by returning a string representing a comma delimited list of its values.

Parameters:
array - the doubles to merge
Returns:
a string representing a comma delimited list of the values of the array of double-precision decimal numbers, an empty string if the array is empty, or null if the array is null

merge

public static String merge(double[] array,
                           String delimiter)
Merges the elements of an array of double-precision decimal numbers by returning a string representing a delimited list of its values.

Parameters:
array - the doubles to merge
delimiter - the delimiter
Returns:
a string representing a delimited list of the values of the array of double-precision decimal numbers, an empty string if the array is empty, or null if the array is null

merge

public static String merge(float[] array)
Merges the elements of an array of decimal numbers into a string representing a comma delimited list of its values.

Parameters:
array - the floats to merge
Returns:
a string representing a comma delimited list of the values of the array of decimal numbers, an empty string if the array is empty, or null if the array is null

merge

public static String merge(float[] array,
                           String delimiter)
Merges the elements of an array of decimal numbers into a string representing a delimited list of its values.

Parameters:
array - the floats to merge
delimiter - the delimiter
Returns:
a string representing a delimited list of the values of the array of decimal numbers, an empty string if the array is empty, or null if the array is null

merge

public static String merge(int[] array)
Merges the elements of an array of integers into a string representing a comma delimited list of its values.

Parameters:
array - the integers to merge
Returns:
a string representing a comma delimited list of the values of the array of integers, an empty string if the array is empty, or null if the array is null

merge

public static String merge(int[] array,
                           String delimiter)
Merges the elements of an array of integers into a string representing a delimited list of its values.

Parameters:
array - the integers to merge
delimiter - the delimiter
Returns:
a string representing a delimited list of the values of the array of integers, an empty string if the array is empty, or null if the array is null

merge

public static String merge(long[] array)
Merges the elements of an array of long integers by returning a string representing a comma delimited list of its values.

Parameters:
array - the long integers to merge
Returns:
a string representing a comma delimited list of the values of the array of long integers, an empty string if the array is empty, or null if the array is null

merge

public static String merge(long[] array,
                           String delimiter)
Merges the elements of an array of long integers by returning a string representing a delimited list of its values.

Parameters:
array - the long integers to merge
delimiter - the delimiter
Returns:
a string representing a delimited list of the values of the array of long integers, an empty string if the array is empty, or null if the array is null

merge

public static String merge(Object[] array)
Merges the elements of an array of objects into a string representing a comma delimited list of the objects.

Parameters:
array - the objects to merge
Returns:
a string representing a comma delimited list of the objects, an empty string if the array is empty, or null if the array is null

merge

public static String merge(Object[] array,
                           String delimiter)
Merges the elements of an array of objects into a string representing a delimited list of the objects.

Parameters:
array - the objects to merge
delimiter - the delimiter
Returns:
a string representing a delimited list of the objects, an empty string if the array is empty, or null if the array is null

merge

public static String merge(short[] array)
Merges the elements of an array of short integers by returning a string representing a comma delimited list of its values.

Parameters:
array - the short integers to merge
Returns:
a string representing a comma delimited list of the values of the array of short integers, an empty string if the array is empty, or null if the array is null

merge

public static String merge(short[] array,
                           String delimiter)
Merges the elements of an array of short integers by returning a string representing a delimited list of its values.

Parameters:
array - the short integers to merge
delimiter - the delimiter
Returns:
a string representing a delimited list of the values of the array of short integers, an empty string if the array is empty, or null if the array is null

quote

public static String quote(String s)
Returns the string enclosed by apostrophes.

Example:

 
 quote("Hello, World!") returns "'Hello, World!'"
 
 

Parameters:
s - the string to enclose in apostrophes
Returns:
the string enclosed by apostrophes, or null if the string is null

quote

public static String quote(String s,
                           char quote)
Returns the string enclosed by the quote character.

Example:

 
 quote("PATH", '%') returns "%PATH%"
 
 

Parameters:
s - the string to enclose in quotes
quote - the character to insert to insert to the beginning of and append to the end of the string
Returns:
the string enclosed in the quote characters, or null if the string is null

quote

public static String quote(String s,
                           String quote)
Returns the string enclosed by the quote strings.

Example:

 
 quote("WARNING", "!!!") returns "!!!WARNING!!!"
 
 

Parameters:
s - the string to enclose in quotes
quote - the quote string to insert to insert to the beginning of and append to the end of the string
Returns:
the string enclosed in the quote strings, or null if the string is null

randomize

public static String randomize(String s)
Pseudorandomly permutes the characters of the string.

Parameters:
s - the string whose characters are to be randomized
Returns:
a string of the same length as the string whose characters represent a pseudorandom permutation of the characters of the string

read

public static String read(ClassLoader classLoader,
                          String name)
                   throws IOException
Throws:
IOException

read

public static String read(ClassLoader classLoader,
                          String name,
                          boolean all)
                   throws IOException
Throws:
IOException

read

public static String read(InputStream is)
                   throws IOException
Throws:
IOException

readLines

public static void readLines(InputStream is,
                             Collection<String> lines)
                      throws IOException
Throws:
IOException

remove

public static String remove(String s,
                            String remove)
Removes the remove string from string s that represents a list of comma delimited strings.

The resulting string ends with a comma even if the original string does not.

Examples:

 
 remove("red,blue,green,yellow", "blue") returns "red,green,yellow,"
 remove("blue", "blue") returns ""
 remove("blue,", "blue") returns ""
 
 

Parameters:
s - the string representing the list of comma delimited strings
remove - the string to remove
Returns:
a string representing the list of comma delimited strings with the remove string removed, or null if the original string, the string to remove, or the delimiter is null

remove

public static String remove(String s,
                            String remove,
                            String delimiter)
Removes the remove string from string s that represents a list of delimited strings.

The resulting string ends with the delimiter even if the original string does not.

Examples:

 
 remove("red;blue;green;yellow", "blue", ";") returns "red;green;yellow;"
 remove("blue", "blue", ";") returns ""
 remove("blue;", "blue", ";") returns ""
 
 

Parameters:
s - the string representing the list of delimited strings
remove - the string to remove
delimiter - the delimiter
Returns:
a string representing the list of delimited strings with the remove string removed, or null if the original string, the string to remove, or the delimiter is null

replace

public static String replace(String s,
                             char oldSub,
                             char newSub)
Replaces all occurrences of the character with the new character.

Parameters:
s - the original string
oldSub - the character to be searched for and replaced in the original string
newSub - the character with which to replace the oldSub character
Returns:
a string representing the original string with all occurrences of the oldSub character replaced with the newSub character, or null if the original string is null

replace

public static String replace(String s,
                             char oldSub,
                             String newSub)
Replaces all occurrences of the character with the new string.

Parameters:
s - the original string
oldSub - the character to be searched for and replaced in the original string
newSub - the string with which to replace the oldSub character
Returns:
a string representing the original string with all occurrences of the oldSub character replaced with the string newSub, or null if the original string is null

replace

public static String replace(String s,
                             String oldSub,
                             String newSub)
Replaces all occurrences of the string with the new string.

Parameters:
s - the original string
oldSub - the string to be searched for and replaced in the original string
newSub - the string with which to replace the oldSub string
Returns:
a string representing the original string with all occurrences of the oldSub string replaced with the string newSub, or null if the original string is null

replace

public static String replace(String s,
                             String oldSub,
                             String newSub,
                             int fromIndex)
Replaces all occurrences of the string with the new string, starting from the specified index.

Parameters:
s - the original string
oldSub - the string to be searched for and replaced in the original string
newSub - the string with which to replace the oldSub string
fromIndex - the index of the original string from which to begin searching
Returns:
a string representing the original string with all occurrences of the oldSub string occurring after the specified index replaced with the string newSub, or null if the original string is null

replace

public static String replace(String s,
                             String begin,
                             String end,
                             Map<String,String> values)

replace

public static String replace(String s,
                             String[] oldSubs,
                             String[] newSubs)
Replaces all occurrences of the elements of the string array with the corresponding elements of the new string array.

Parameters:
s - the original string
oldSubs - the strings to be searched for and replaced in the original string
newSubs - the strings with which to replace the oldSubs strings
Returns:
a string representing the original string with all occurrences of the oldSubs strings replaced with the corresponding newSubs strings, or null if the original string, the oldSubs array, or the newSubs is null

replace

public static String replace(String s,
                             String[] oldSubs,
                             String[] newSubs,
                             boolean exactMatch)
Replaces all occurrences of the elements of the string array with the corresponding elements of the new string array, optionally replacing only substrings that are surrounded by word boundaries.

Examples:

 
 replace("redorangeyellow", {"red", "orange", "yellow"}, {"RED","ORANGE", "YELLOW"}, false) returns "REDORANGEYELLOW"
 replace("redorangeyellow", {"red", "orange", "yellow"}, {"RED","ORANGE", "YELLOW"}, true) returns "redorangeyellow"
 replace("redorange yellow", {"red", "orange", "yellow"}, {"RED","ORANGE", "YELLOW"}, false) returns "REDORANGE YELLOW"
 replace("redorange yellow", {"red", "orange", "yellow"}, {"RED","ORANGE", "YELLOW"}, true) returns "redorange YELLOW"
 replace("red orange yellow", {"red", "orange", "yellow"}, {"RED","ORANGE", "YELLOW"}, false) returns "RED ORANGE YELLOW"
 replace("redorange.yellow", {"red", "orange", "yellow"}, {"RED","ORANGE", * "YELLOW"}, true) returns "redorange.YELLOW"
 
 

Parameters:
s - the original string
oldSubs - the strings to be searched for and replaced in the original string
newSubs - the strings with which to replace the oldSubs strings
exactMatch - whether or not to replace only substrings of s that are surrounded by word boundaries
Returns:
if exactMatch is true, a string representing the original string with all occurrences of the oldSubs strings that are surrounded by word boundaries replaced with the corresponding newSubs strings, or else a string representing the original string with all occurrences of the oldSubs strings replaced with the corresponding newSubs strings, or null if the original string, the oldSubs array, or the newSubsnull

replaceFirst

public static String replaceFirst(String s,
                                  char oldSub,
                                  char newSub)
Replaces the first occurrence of the character with the new character.

Parameters:
s - the original string
oldSub - the character whose first occurrence in the original string is to be searched for and replaced
newSub - the character with which to replace the first occurrence of the oldSub character
Returns:
a string representing the original string except with the first occurrence of the character oldSub replaced with the character newSub

replaceFirst

public static String replaceFirst(String s,
                                  char oldSub,
                                  String newSub)
Replaces the first occurrence of the character with the new string.

Parameters:
s - the original string
oldSub - the character whose first occurrence in the original string is to be searched for and replaced
newSub - the string with which to replace the first occurrence of the oldSub character
Returns:
a string representing the original string except with the first occurrence of the character oldSub replaced with the string newSub

replaceFirst

public static String replaceFirst(String s,
                                  String oldSub,
                                  String newSub)
Replaces the first occurrence of the string with the new string.

Parameters:
s - the original string
oldSub - the string whose first occurrence in the original string is to be searched for and replaced
newSub - the string with which to replace the first occurrence of the oldSub string
Returns:
a string representing the original string except with the first occurrence of the string oldSub replaced with the string newSub

replaceFirst

public static String replaceFirst(String s,
                                  String[] oldSubs,
                                  String[] newSubs)
Replaces the first occurrences of the elements of the string array with the corresponding elements of the new string array.

Parameters:
s - the original string
oldSubs - the strings whose first occurrences are to be searched for and replaced in the original string
newSubs - the strings with which to replace the first occurrences of the oldSubs strings
Returns:
a string representing the original string with the first occurrences of the oldSubs strings replaced with the corresponding newSubs strings, or null if the original string, the oldSubs array, or the newSubsnull

replaceLast

public static String replaceLast(String s,
                                 char oldSub,
                                 char newSub)
Replaces the last occurrence of the character with the new character.

Parameters:
s - the original string
oldSub - the character whose last occurrence in the original string is to be searched for and replaced
newSub - the character with which to replace the last occurrence of the oldSub character
Returns:
a string representing the original string except with the first occurrence of the character oldSub replaced with the character newSub

replaceLast

public static String replaceLast(String s,
                                 char oldSub,
                                 String newSub)
Replaces the last occurrence of the character with the new string.

Parameters:
s - the original string
oldSub - the character whose last occurrence in the original string is to be searched for and replaced
newSub - the string with which to replace the last occurrence of the oldSub character
Returns:
a string representing the original string except with the last occurrence of the character oldSub replaced with the string newSub

replaceLast

public static String replaceLast(String s,
                                 String oldSub,
                                 String newSub)
Replaces the last occurrence of the string oldSub in the string s with the string newSub.

Parameters:
s - the original string
oldSub - the string whose last occurrence in the original string is to be searched for and replaced
newSub - the string with which to replace the last occurrence of the oldSub string
Returns:
a string representing the original string except with the last occurrence of the string oldSub replaced with the string newSub

replaceLast

public static String replaceLast(String s,
                                 String[] oldSubs,
                                 String[] newSubs)
Replaces the last occurrences of the elements of the string array with the corresponding elements of the new string array.

Parameters:
s - the original string
oldSubs - the strings whose last occurrences are to be searched for and replaced in the original string
newSubs - the strings with which to replace the last occurrences of the oldSubs strings
Returns:
a string representing the original string with the last occurrences of the oldSubs strings replaced with the corresponding newSubs strings, or null if the original string, the oldSubs array, or the newSubsnull

replaceToStringBundler

public static StringBundler replaceToStringBundler(String s,
                                                   String begin,
                                                   String end,
                                                   Map<String,String> values)

replaceWithStringBundler

public static StringBundler replaceWithStringBundler(String s,
                                                     String begin,
                                                     String end,
                                                     Map<String,StringBundler> values)

reverse

public static String reverse(String s)
Reverses the order of the characters of the string.

Parameters:
s - the original string
Returns:
a string representing the original string with characters in reverse order

safePath

public static String safePath(String path)
Replaces all double slashes of the string with single slashes.

Example:

 
 safePath("http://www.liferay.com") returns "http:/www.liferay.com"
 
 

Parameters:
path - the original string
Returns:
a string representing the original string with all double slashes replaced with single slashes

shorten

public static String shorten(String s)
Returns a string representing the original string appended with suffix "..." and then shortened to 20 characters.

The suffix is only added if the original string exceeds 20 characters. If the original string exceeds 20 characters and it contains whitespace, the string is shortened at the first whitespace character.

Examples:

 
 shorten("12345678901234567890xyz") returns "12345678901234567..."
 shorten("1 345678901234567890xyz") returns "1..."
 shorten(" 2345678901234567890xyz") returns "..."
 shorten("12345678901234567890") returns "12345678901234567890"
 shorten(" 2345678901234567890") returns " 2345678901234567890"
 
 

Parameters:
s - the original string
Returns:
a string representing the original string shortened to 20 characters, with suffix "..." appended to it

shorten

public static String shorten(String s,
                             int length)
Returns a string representing the original string appended with suffix "..." and then shortened to the specified length.

The suffix is only added if the original string exceeds the specified length. If the original string exceeds the specified length and it contains whitespace, the string is shortened at the first whitespace character.

Examples:

 
 shorten("123456789", 8) returns "12345..."
 shorten("1 3456789", 8) returns "1..."
 shorten(" 23456789", 8) returns "..."
 shorten("12345678", 8) returns "12345678"
 shorten(" 1234567", 8) returns " 1234567"
 
 

Parameters:
s - the original string
length - the number of characters to limit from the original string
Returns:
a string representing the original string shortened to the specified length, with suffix "..." appended to it

shorten

public static String shorten(String s,
                             int length,
                             String suffix)
Returns a string representing the original string appended with the specified suffix and then shortened to the specified length.

The suffix is only added if the original string exceeds the specified length. If the original string exceeds the specified length and it contains whitespace, the string is shortened at the first whitespace character.

Examples:

 
 shorten("12345678901234", 13, "... etc.") returns "12345... etc."
 shorten("1 345678901234", 13, "... etc.") returns "1... etc."
 shorten(" 2345678901234", 13, "... etc.") returns "... etc."
 shorten("1234567890123", 13, "... etc.") returns "1234567890123"
 shorten(" 123456789012", 13, "... etc.") returns " 123456789012"
 
 

Parameters:
s - the original string
length - the number of characters to limit from the original string
suffix - the suffix to append
Returns:
a string representing the original string shortened to the specified length, with the specified suffix appended to it

shorten

public static String shorten(String s,
                             String suffix)
Returns a string representing the original string appended with the specified suffix and then shortened to 20 characters.

The suffix is only added if the original string exceeds 20 characters. If the original string exceeds 20 characters and it contains whitespace, the string is shortened at the first whitespace character.

Examples:

 
 shorten("12345678901234567890xyz", "... etc.") returns "123456789012... etc."
 shorten("1 345678901234567890xyz", "... etc.") returns "1... etc."
 shorten(" 2345678901234567890xyz", "... etc.") returns "... etc."
 shorten("12345678901234567890", "... etc.") returns "12345678901234567890"
 shorten(" 2345678901234567890", "... etc.") returns " 2345678901234567890"
 
 

Parameters:
s - the original string
suffix - the suffix to append
Returns:
a string representing the original string shortened to 20 characters, with the specified suffix appended to it

split

public static String[] split(String s)
Splits string s around comma characters.

Example:

 
 split("Alice,Bob,Charlie") returns {"Alice", "Bob", "Charlie"}
 split("Alice, Bob, Charlie") returns {"Alice", " Bob", " Charlie"}
 
 

Parameters:
s - the string to split
Returns:
the array of strings resulting from splitting string s around comma characters, or an empty string array if s is null or s is empty

split

public static boolean[] split(String s,
                              boolean x)
Splits the string s around comma characters returning the boolean values of the substrings.

Parameters:
s - the string to split
x - the default value to use for a substring in case an exception occurs in getting the boolean value for that substring
Returns:
the array of boolean values resulting from splitting string s around comma characters, or an empty array if s is null

split

public static String[] split(String s,
                             char delimiter)
Splits the string s around the specified delimiter.

Example:

 
 splitLines("First;Second;Third", ';') returns {"First","Second","Third"}
 
 

Parameters:
s - the string to split
delimiter - the delimiter
Returns:
the array of strings resulting from splitting string s around the specified delimiter character, or an empty string array if s is null or if s is empty

split

public static double[] split(String s,
                             double x)
Splits the string s around comma characters returning the double-precision decimal values of the substrings.

Parameters:
s - the string to split
x - the default value to use for a substring in case an exception occurs in getting the double-precision decimal value for that substring
Returns:
the array of double-precision decimal values resulting from splitting string s around comma characters, or an empty array if s is null

split

public static float[] split(String s,
                            float x)
Splits the string s around comma characters returning the decimal values of the substrings.

Parameters:
s - the string to split
x - the default value to use for a substring in case an exception occurs in getting the decimal value for that substring
Returns:
the array of decimal values resulting from splitting string s around comma characters, or an empty array if s is null

split

public static int[] split(String s,
                          int x)
Splits the string s around comma characters returning the integer values of the substrings.

Parameters:
s - the string to split
x - the default value to use for a substring in case an exception occurs in getting the integer value for that substring
Returns:
the array of integer values resulting from splitting string s around comma characters, or an empty array if s is null

split

public static long[] split(String s,
                           long x)
Splits the string s around comma characters returning the long integer values of the substrings.

Parameters:
s - the string to split
x - the default value to use for a substring in case an exception occurs in getting the long integer value for that substring
Returns:
the array of long integer values resulting from splitting string s around comma characters, or an empty array if s is null

split

public static short[] split(String s,
                            short x)
Splits the string s around comma characters returning the short integer values of the substrings.

Parameters:
s - the string to split
x - the default value to use for a substring in case an exception occurs in getting the short integer value for that substring
Returns:
the array of short integer values resulting from splitting string s around comma characters, or an empty array if s is null

split

public static String[] split(String s,
                             String delimiter)
Splits the string s around the specified delimiter string.

Example:

 
 splitLines("oneandtwoandthreeandfour", "and") returns {"one","two","three","four"}
 
 

Parameters:
s - the string to split
delimiter - the delimiter
Returns:
the array of strings resulting from splitting string s around the specified delimiter string, or an empty string array if s is null or equals the delimiter

split

public static boolean[] split(String s,
                              String delimiter,
                              boolean x)
Splits the string s around the specified delimiter returning the boolean values of the substrings.

Parameters:
s - the string to split
delimiter - the delimiter
x - the default value to use for a substring in case an exception occurs in getting the boolean value for that substring
Returns:
the array of booleans resulting from splitting string s around the specified delimiter string, or an empty array if s is null

split

public static double[] split(String s,
                             String delimiter,
                             double x)
Splits the string s around the specified delimiter returning the double-precision decimal values of the substrings.

Parameters:
s - the string to split
delimiter - the delimiter
x - the default value to use for a substring in case an exception occurs in getting the double-precision decimal value for that substring
Returns:
the array of double-precision decimal values resulting from splitting string s around the specified delimiter string, or an empty array if s is null

split

public static float[] split(String s,
                            String delimiter,
                            float x)
Splits the string s around the specified delimiter returning the decimal values of the substrings.

Parameters:
s - the string to split
delimiter - the delimiter
x - the default value to use for a substring in case an exception occurs in getting the decimal value for that substring
Returns:
the array of decimal values resulting from splitting string s around the specified delimiter string, or an empty array if s is null

split

public static int[] split(String s,
                          String delimiter,
                          int x)
Splits the string s around the specified delimiter returning the integer values of the substrings.

Parameters:
s - the string to split
delimiter - the delimiter
x - the default value to use for a substring in case an exception occurs in getting the integer value for that substring
Returns:
the array of integer values resulting from splitting string s around the specified delimiter string, or an empty array if s is null

split

public static long[] split(String s,
                           String delimiter,
                           long x)
Splits the string s around the specified delimiter returning the long integer values of the substrings.

Parameters:
s - the string to split
delimiter - the delimiter
x - the default value to use for a substring in case an exception occurs in getting the long integer value for that substring
Returns:
the array of long integer values resulting from splitting string s around the specified delimiter string, or an empty array if s is null

split

public static short[] split(String s,
                            String delimiter,
                            short x)
Splits the string s around the specified delimiter returning the short integer values of the substrings.

Parameters:
s - the string to split
delimiter - the delimiter
x - the default value to use for a substring in case an exception occurs in getting the short integer value for that substring
Returns:
the array of short integer values resulting from splitting string s around the specified delimiter string, or an empty array if s is null

splitLines

public static String[] splitLines(String s)
Splits string s around return and newline characters.

Example:

 
 splitLines("Red\rBlue\nGreen") returns {"Red","Blue","Green"}
 
 

Parameters:
s - the string to split
Returns:
the array of strings resulting from splitting string s around return and newline characters, or an empty string array if string s is null

startsWith

public static boolean startsWith(String s,
                                 char begin)
Returns true if, ignoring case, the string starts with the specified character.

Parameters:
s - the string
begin - the character against which the initial character of the string is to be compared
Returns:
true if, ignoring case, the string starts with the specified character; false otherwise

startsWith

public static boolean startsWith(String s,
                                 String start)
Returns true if, ignoring case, the string starts with the specified start string.

Parameters:
s - the original string
start - the string against which the beginning of string s are to be compared
Returns:
true if, ignoring case, the string starts with the specified start string; false otherwise

startsWithWeight

public static int startsWithWeight(String s1,
                                   String s2)
Returns the number of starting characters that s1 and s2 have in common before their characters deviate.

Parameters:
s1 - string 1
s2 - string 2
Returns:
the number of starting characters that s1 and s2 have in common before their characters deviate

strip

public static String strip(String s,
                           char remove)
Returns a string representing the string s with all occurrences of the specified character removed.

Example:

 
 strip("Mississipi", 'i') returns "Mssssp"
 
 

Parameters:
s - the string from which to strip all occurrences the character
remove - the character to strip from the string
Returns:
a string representing the string s with all occurrences of the specified character removed, or null if s is null

stripBetween

public static String stripBetween(String s,
                                  String begin,
                                  String end)
Returns a string representing the combination of the substring of s up to but not including the string begin concatenated with the substring of s after but not including the string end.

Example:

 
 stripBetween("One small step for man, one giant leap for mankind", "step", "giant ") returns "One small leap for mankind"
 
 

Parameters:
s - the from which to strip a substring
begin - the beginning characters of the substring to be removed
end - the ending characters of the substring to be removed
Returns:
a string representing the combination of the substring of s up to but not including the string begin concatenated with the substring of s after but not including the string end, or the original string if the value of s, begin, or end are null

toCharCode

public static String toCharCode(String s)
Returns a string representing the Unicode character codes of the characters comprising the string s.

Example:

 
 toCharCode("a") returns "97"
 toCharCode("b") returns "98"
 toCharCode("c") returns "99"
 toCharCode("What's for lunch?") returns "87104971163911532102111114321081171109910463"
 
 

Parameters:
s - the string whose character codes are to be represented
Returns:
a string representing the Unicode character codes of the characters comprising the string s

toHexString

public static String toHexString(int i)

toHexString

public static String toHexString(long l)

toHexString

public static String toHexString(Object obj)

trim

public static String trim(String s)
Trims all leading and trailing whitespace from the string.

Parameters:
s - the original string
Returns:
a string representing the original string with all leading and trailing whitespace removed

trim

public static String trim(String s,
                          char c)
Trims leading and trailing whitespace from the string, up to but not including the whitespace character specified by c.

Examples:

 
 trim(" \tHey\t ", '\t') returns "\tHey\t"
 trim(" \t Hey \t ", '\t') returns "\t Hey \t"
 
 

Parameters:
s - the original string
c - the whitespace character to limit trimming
Returns:
a string representing the original string with leading and trailing whitespace removed, up to but not including the whitespace character specified by c

trim

public static String trim(String s,
                          char[] exceptions)
Trims leading and trailing whitespace from the string, up to but not including the whitespace characters specified by exceptions.

Parameters:
s - the original string
exceptions - the whitespace characters to limit trimming
Returns:
a string representing the original string with leading and trailing whitespace removed, up to but not including the whitespace characters specified by exceptions

trimLeading

public static String trimLeading(String s)
Trims all leading whitespace from the string.

Parameters:
s - the original string
Returns:
a string representing the original string with all leading whitespace removed

trimLeading

public static String trimLeading(String s,
                                 char c)
Trims leading whitespace from the string, up to but not including the whitespace character specified by c.

Parameters:
s - the original string
c - the whitespace character to limit trimming
Returns:
a string representing the original string with leading whitespace removed, up to but not including the whitespace character specified by c

trimLeading

public static String trimLeading(String s,
                                 char[] exceptions)
Trims leading whitespace from the string, up to but not including the whitespace characters specified by exceptions.

Parameters:
s - the original string
exceptions - the whitespace characters to limit trimming
Returns:
a string representing the original string with leading whitespace removed, up to but not including the whitespace characters specified by exceptions

trimTrailing

public static String trimTrailing(String s)
Trims all trailing whitespace from the string.

Parameters:
s - the original string
Returns:
a string representing the original string with all trailing whitespace removed

trimTrailing

public static String trimTrailing(String s,
                                  char c)
Trims trailing whitespace from the string, up to but not including the whitespace character specified by c.

Parameters:
s - the original string
c - the whitespace character to limit trimming
Returns:
a string representing the original string with trailing whitespace removed, up to but not including the whitespace character specified by c

trimTrailing

public static String trimTrailing(String s,
                                  char[] exceptions)
Trims trailing whitespace from the string, up to but not including the whitespace characters specified by exceptions.

Parameters:
s - the original string
exceptions - the whitespace characters to limit trimming
Returns:
a string representing the original string with trailing whitespace removed, up to but not including the whitespace characters specified by exceptions

unquote

public static String unquote(String s)
Removes leading and trailing double and single quotation marks from the string.

Parameters:
s - the original string
Returns:
a string representing the original string with leading and trailing double and single quotation marks removed, or the original string if the original string is a null or empty

upperCase

public static String upperCase(String s)
Converts all of the characters in the string to upper case.

Parameters:
s - the string to convert
Returns:
the string, converted to upper-case, or null if the string is null
See Also:
String.toUpperCase()

upperCaseFirstLetter

public static String upperCaseFirstLetter(String s)
Converts the first character of the string to upper case.

Parameters:
s - the string whose first character is to be converted
Returns:
the string, with its first character converted to upper-case

valueOf

public static String valueOf(Object obj)
Returns the string value of the object.

Parameters:
obj - the object whose string value is to be returned
Returns:
the string value of the object
See Also:
String.valueOf(Object obj)

wrap

public static String wrap(String text)

wrap

public static String wrap(String text,
                          int width,
                          String lineSeparator)

Liferay 6.1.2-ce-ga3