Java com.liferay.portal.kernel.util StringUtil fields, constructors, methods, implement or subclass

Example usage for Java com.liferay.portal.kernel.util StringUtil fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for com.liferay.portal.kernel.util StringUtil.

The text is from its open source code.

Subclass

com.liferay.portal.kernel.util.StringUtil has subclasses.
Click this link to see all its subclasses.

Method

Stringadd(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.
Stringadd(String s, String add)
Adds string add to string s resulting in a comma delimited list of strings, disallowing duplicate strings in the list.
StringappendParentheticalSuffix(String s, int suffix)
Returns the original string with an appended space followed by the string value of the suffix surrounded by parentheses.
StringappendParentheticalSuffix(String s, String suffix)
Returns the original string with an appended space followed by the suffix surrounded by parentheses.
booleancontains(String s, String text)
Returns true if the string contains the text as one or more consecutive comma delimited list entries.
intcount(String s, char c)
intcount(String s, String text)
Returns the number of times the text appears in the string.
booleanendsWith(String s, char end)
Returns true if the string ends with the specified character, ignoring case.
booleanendsWith(String s, String end)
Returns true if the string ends with the string end, ignoring case.
booleanequals(String s1, String s2)
Returns true if the strings are equal.
booleanequalsIgnoreCase(char c1, char c2)
booleanequalsIgnoreCase(String s1, String s2)
Returns true if the strings are equal, ignoring case.
StringextractDigits(String s)
Returns a string consisting of all of the digits extracted from the string.
StringextractFirst(String s, char delimiter)
Returns the substring of s up to but not including the first occurrence of the delimiter.
StringextractFirst(String s, String delimiter)
Returns the substring of s up to but not including the first occurrence of the delimiter.
StringextractLast(String s, char delimiter)
Returns the substring of s after but not including the last occurrence of the delimiter.
StringextractLast(String s, String delimiter)
Returns the substring of s after but not including the last occurrence of the delimiter.
StringextractLeadingDigits(String s)
Returns the substring of all leading digits of string s, or an empty string if it has no leading digits.
intindexOfAny(String s, char[] chars, int fromIndex)
Returns the index within the string of the first occurrence of any character from the array, starting the search at the specified index within the string.
intindexOfAny(String s, String[] texts, int fromIndex)
Returns the index within the string of the first occurrence of any string from the array, starting the search at the specified index within the string.
intindexOfAny(String s, char[] chars, int fromIndex, int toIndex)
Returns the index within the string of the first occurrence of any character from the array, up to and including the specified end index within the string, starting the search at the specified start index within the string.
intindexOfAny(String s, String[] texts, int fromIndex, int toIndex)
Returns the index within the string of the first occurrence of any string from the array, up to and including the specified end index within the string, starting the search at the specified start index within the string.
intindexOfAny(String s, char[] chars)
Returns the index within the string of the first occurrence of any character from the array.
intindexOfAny(String s, String[] texts)
Returns the index within the string of the first occurrence of any string from the array.
Stringinsert(String s, String insert, int offset)
Inserts one string into the other at the specified offset index.
booleanisLowerCase(String s)
Returns true if all the characters in string s are lower case, ignoring any non-alphabetic characters.
booleanisUpperCase(String s)
Returns true if all the characters in string s are upper case, ignoring any non-alphabetic characters.
intlastIndexOfAny(String s, char[] chars, int toIndex)
Returns the index within the string of the last occurrence of any character from the array, starting the search at the specified index within the string.
intlastIndexOfAny(String s, String[] texts, int toIndex)
Returns the index within the string of the last occurrence of any string from the array, starting the search at the specified index within the string.
StringlowerCase(String s)
Converts all of the characters in the string to lower case.
voidlowerCase(String... array)
Converts all of the characters in the arbitrary number of strings to lower case.
Stringmerge(boolean[] array)
Merges the elements of the boolean array into a string representing a comma delimited list of its values.
Stringmerge(char[] array)
Merges the elements of the character array into a string representing a comma delimited list of its values.
Stringmerge(Collection col)
Merges the elements of the collection by returning a string representing a comma delimited list of its values.
Stringmerge(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.
Stringmerge(float[] array)
Merges the elements of an array of decimal numbers into a string representing a comma delimited list of its values.
Stringmerge(int[] array)
Merges the elements of an array of integers into a string representing a comma delimited list of its values.
Stringmerge(long[] array)
Merges the elements of an array of long integers by returning a string representing a comma delimited list of its values.
Stringmerge(Object[] array)
Merges the elements of an array of objects into a string representing a comma delimited list of the objects.
Stringmerge(short[] array)
Merges the elements of an array of short integers by returning a string representing a comma delimited list of its values.
Stringmerge(boolean[] array, String delimiter)
Merges the elements of the boolean array into a string representing a delimited list of its values.
Stringmerge(char[] array, String delimiter)
Merges the elements of the character array into a string representing a delimited list of its values.
Stringmerge(Collection col, String delimiter)
Merges the elements of the collection by returning a string representing a delimited list of its values.
Stringmerge(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.
Stringmerge(float[] array, String delimiter)
Merges the elements of an array of decimal numbers into a string representing a delimited list of its values.
Stringmerge(int[] array, String delimiter)
Merges the elements of an array of integers into a string representing a delimited list of its values.
Stringmerge(long[] array, String delimiter)
Merges the elements of an array of long integers by returning a string representing a delimited list of its values.
Stringmerge(Object[] array, String delimiter)
Merges the elements of an array of objects into a string representing a delimited list of the objects.
Stringmerge(short[] array, String delimiter)
Merges the elements of an array of short integers by returning a string representing a delimited list of its values.
Stringquote(String s, char quote)
Returns the string enclosed by the quote character.
Stringquote(String s, String quote)
Returns the string enclosed by the quote strings.
Stringquote(String s)
Returns the string enclosed by apostrophes.
StringrandomId()
Returns a randomized string of four lower case, alphabetic characters.
StringrandomString()
Returns a randomized string of eight characters consisting of lower case letters, upper case letters, and single-digit whole numbers.
StringrandomString(int length)
Returns a randomized string of the specified length consisting of lower case letters, upper case letters, and single-digit whole numbers.
Stringread(Class clazz, String name)
Stringread(ClassLoader classLoader, String name)
Stringread(ClassLoader classLoader, String name, boolean all)
Stringread(InputStream is)
StringremoveChar(String s, char oldSub)
StringremoveFromList(String s, String element)
Removes the remove string from string s that represents a list of comma delimited strings.
StringremoveSubstring(String s, String oldSub)
Stringreplace(String s, char oldSub, char newSub)
Replaces all occurrences of the character with the new character.
Stringreplace(String s, char oldSub, String newSub)
Replaces all occurrences of the character with the new string.
Stringreplace(String s, char[] oldSubs, char[] newSubs)
Stringreplace(String s, char[] oldSubs, String[] newSubs)
Stringreplace(String s, String oldSub, String newSub)
Replaces all occurrences of the string with the new string.
Stringreplace(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.
Stringreplace(String s, String oldSub, String newSub, int fromIndex)
Replaces all occurrences of the string with the new string, starting from the specified index.
Stringreplace(String s, String begin, String end, Map values)
Replaces all occurrences of the keywords found in the substring, defined by the beginning and ending strings, with the new values.
Stringreplace(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.
StringreplaceFirst(String s, char oldSub, char newSub)
Replaces the first occurrence of the character with the new character.
StringreplaceFirst(String s, char oldSub, String newSub)
Replaces the first occurrence of the character with the new string.
StringreplaceFirst(String s, String oldSub, String newSub)
Replaces the first occurrence of the string with the new string.
StringreplaceFirst(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.
StringreplaceFirst(String s, String oldSub, String newSub, int fromIndex)
Replaces the first occurrences of the elements of the string array with the corresponding elements of the new string array, beginning the element search from the index position.
StringreplaceLast(String s, char oldSub, char newSub)
Replaces the last occurrence of the character with the new character.
StringreplaceLast(String s, char oldSub, String newSub)
Replaces the last occurrence of the character with the new string.
StringreplaceLast(String s, String oldSub, String newSub)
Replaces the last occurrence of the string oldSub in the string s with the string newSub.
StringreplaceLast(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.
StringBundlerreplaceToStringBundler(String s, String begin, String end, Map values)
Replaces all occurrences of the keywords found in the substring, defined by the beginning and ending strings, with the new values.
StringBundlerreplaceWithStringBundler(String s, String begin, String end, Map values)
Replaces all occurrences of the keywords found in the substring, defined by the beginning and ending strings, with the new values.
Stringshorten(String s, int length)
Returns a string representing the original string appended with suffix "..."
Stringshorten(String s, String suffix)
Returns a string representing the original string appended with the specified suffix and then shortened to 20 characters.
Stringshorten(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.
Stringshorten(String s)
Returns a string representing the original string appended with suffix "..."
String[]split(String s)
Splits string s around comma characters.
boolean[]split(String s, boolean x)
Splits the string s around comma characters returning the boolean values of the substrings.
String[]split(String s, char delimiter)
Splits the string s around the specified delimiter.
double[]split(String s, double x)
Splits the string s around comma characters returning the double-precision decimal values of the substrings.
float[]split(String s, float x)
Splits the string s around comma characters returning the decimal values of the substrings.
int[]split(String s, int x)
Splits the string s around comma characters returning the integer values of the substrings.
long[]split(String s, long x)
Splits the string s around comma characters returning the long integer values of the substrings.
short[]split(String s, short x)
Splits the string s around comma characters returning the short integer values of the substrings.
String[]split(String s, String delimiter)
Splits the string s around the specified delimiter string.
String[]splitLines(String s)
Splits string s around return and newline characters.
booleanstartsWith(String s, char begin)
Returns true if, ignoring case, the string starts with the specified character.
booleanstartsWith(String s, String start)
Returns true if, ignoring case, the string starts with the specified start string.
intstartsWithWeight(String s1, String s2)
Returns the number of starting characters that s1 and s2 have in common before their characters deviate.
StringstripBetween(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.
StringstripCDATA(String s)
Returns a string representing the string s with its <![CDATA[]]> wrapper removed.
StringtoHexString(int i)
Returns a string representing the hexidecimal character code of the integer.
StringtoHexString(long l)
Returns a string representing the hexidecimal character code of the long integer.
StringtoHexString(Object obj)
Returns a string representing the hexidecimal character code of the Integer or Long object type.
StringtoLowerCase(String s)
Converts all of the characters in the string to lower case, based on the portal instance's default locale.
StringtoUpperCase(String s)
Converts all of the characters in the string to upper case, based on the portal instance's default locale.
Stringtrim(String s)
Trims all leading and trailing whitespace from the string.
Stringtrim(String s, char c)
Trims leading and trailing whitespace from the string, up to but not including the whitespace character specified by c.
Stringtrim(String s, char[] exceptions)
Trims leading and trailing whitespace from the string, up to but not including the whitespace characters specified by exceptions.
StringtrimLeading(String s)
Trims all leading whitespace from the string.
StringtrimTrailing(String s)
Trims all trailing whitespace from the string.
Stringunquote(String s)
Removes leading and trailing double and single quotation marks from the string.
StringupperCase(String s)
Converts all of the characters in the string to upper case.
StringupperCaseFirstLetter(String s)
Converts the first character of the string to upper case.
booleanwildcardMatches(String s, String wildcard, char singleWildcardCharacter, char multipleWildcardCharacter, char escapeWildcardCharacter, boolean caseSensitive)
Returns true if the string matches the wildcard pattern.