Class StringUtils
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic Stringabbreviate(String in, int length) Abbreviates a String using ellipses.static byte[]base64Decode(String in) BASE64-decodes the specified string.static StringShortcut for callingbase64Decode(String) and converting the result to a UTF-8 encoded string.static Stringbase64Encode(byte[] in) BASE64-encodes the specified byte array.static StringShortcut for callingbase64Encode(in.getBytes("UTF-8" ))static charReturns the character at the specified index in the string without throwing exceptions.static intCompares two strings, but gracefully handlesnulls .static byte[]Converts string into a GZipped input stream.static booleancontains(String value, CharSequence substring) Same asString.contains(CharSequence)except returnsnull if the value is null.static booleancontainsAny(String s, char... chars) Returnstrue if the specified string contains any of the specified characters.static intcountChars(String s, char c) Counts the number of the specified character in the specified string.static StringDebug method for rendering non-ASCII character sequences.static Stringdecompress(byte[] is) Converts a GZipped input stream into a string.static intdiffPosition(String s1, String s2) Finds the position where the two strings differ.static intdiffPositionIc(String s1, String s2) Finds the position where the two strings differ ignoring case.static booleanAn efficient method for checking if a string ends with a character.static booleanSame asendsWith(String, char)except check for multiple characters.static StringescapeChars(String s, AsciiSet escaped) Escapes the specified characters in the string.static charReturns the first character in the specified string.static StringfirstNonEmpty(String... s) Returns the first non-null, non-empty string in the list.static charReturns the first non-whitespace character in the string.static StringAttempts to escape any invalid characters found in a URI.static StringSimilar toMessageFormat.format(String, Object...)except allows you to specify POJO arguments.static byte[]Converts a hexadecimal character string to a byte array.static StringfromHexToUTF8(String hex) Converts a hexadecimal byte stream (e.g. "34A5BC") into a UTF-8 encoded string.static byte[]fromSpacedHex(String hex) Same asfromHex(String)except expects spaces between the byte strings.static StringConverts a space-deliminted hexadecimal byte stream (e.g. "34 A5 BC") into a UTF-8 encoded string.static StringGiven an absolute URI, returns just the authority portion (e.g.static longParses a duration string.static StringTakes in a string, splits it by lines, and then prepends each line with line numbers.static StringgetNumberedLines(String s, int start, int end) Same asgetNumberedLines(String)except only returns the specified lines.static intSame asString.indexOf(int)except allows you to check for multiple characters.static booleanEfficiently determines whether a URL is of the pattern "xxx://xxx"static booleanReturnstrue if the specified string is numeric.static booleanisFirstNumberChar(char c) Returnstrue if the specified character is a valid first character for a number.static booleanReturnstrue if the specified string is a floating point number.static booleanReturnstrue if the specified string is valid JSON.static booleanisJsonArray(Object o, boolean ignoreWhitespaceAndComments) Returnstrue if the specified string appears to be an JSON array.static booleanisJsonObject(Object o, boolean ignoreWhitespaceAndComments) Returnstrue if the specified string appears to be a JSON object.static booleanisNumberChar(char c) Returnstrue if the specified character is a valid number character.static booleanReturnstrue if this string can be parsed byparseNumber(String, Class).static booleanReturnstrue if the specified string is one of the specified values.static booleanEfficiently determines whether a URL is of the pattern "xxx:/xxx".static StringSame asUtils.join(Collection, char)but escapes the delimiter if found in the tokens.static charReturns the last non-whitespace character in the string.static CharacterConverts aString to aCharacter static intConverts a string containing a possible multiplier suffix to an integer.static CalendarparseIsoCalendar(String date) Parses an ISO8601 string into a calendar.static DateparseIsoDate(String date) Parses an ISO8601 string into a date.static longConverts a string containing a possible multiplier suffix to a long.static NumberparseNumber(String s, Class<? extends Number> type) Parses a number from the specified string.static Stringrandom(int numchars) Generated a random UUID with the specified number of characters.static StringCreates a repeated pattern.static StringReplaces"\\uXXXX" character sequences with their unicode characters.static StringreplaceVars(String s, Map<String, Object> m) Simple utility for replacing variables of the form"{key}" with values in the specified map.static booleanstartsWith(String s, char c) An efficient method for checking if a string starts with a character.static StringConverts the specified array to a string.static StringStrips the first and last character from a string.static StringStrips invalid characters such as CTRL characters from a string meant to be encoded as an HTTP header value.static StringConverts the specified object to a comma-delimited list.static StringtoHex(byte b) Converts the specified byte into a 2 hexadecimal characters.static StringtoHex(byte[] bytes) Converts a byte array into a simple hexadecimal character string.static StringtoHex(InputStream is) Converts the contents of the specified input stream to a hex string.static char[]toHex2(int num) Converts the specified number into a 2 hexadecimal characters.static char[]toHex4(int num) Converts the specified number into a 4 hexadecimal characters.static char[]toHex8(long num) Converts the specified number into a 8 hexadecimal characters.static StringConverts the specified object to an ISO8601 date string.static StringConverts the specified object to an ISO8601 date-time string.static StringtoReadableBytes(byte[] b) Converts the specified bytes into a readable string.static StringtoSpacedHex(byte[] bytes) Same astoHex(byte[])but puts spaces between the byte strings.static URIConverts the specified object to a URI.static StringtoUtf8(byte[] b) Converts the specified byte array to a UTF-8 string.static StringtoUtf8(InputStream is) Converts the contents of the specified input stream to a UTF-8 string.static StringSame asString.trim()but preventsNullPointerExceptions .static StringTrims whitespace characters from the end of the specified string.static StringTrims'/' characters from the beginning of the specified string.static StringTrims'/' characters from both the start and end of the specified string.static StringTrims'/' and space characters from both the start and end of the specified string.static StringTrims whitespace characters from the beginning of the specified string.static StringTrims'/' characters from the end of the specified string.static StringunEscapeChars(String s, AsciiSet escaped) Removes escape characters from the specified characters.static StringunicodeSequence(char c) Creates an escaped-unicode sequence (e.g.static StringDecodes aapplication/x-www-form-urlencoded string usingUTF-8 encoding scheme.static StringEncodes aapplication/x-www-form-urlencoded string usingUTF-8 encoding scheme.static StringSame asurlEncode(String)except only escapes characters that absolutely need to be escaped.static StringSimilar toURLEncoder.encode(String, String)but doesn't encode"/" characters.
- 
Field Details- 
NOT_EMPTYPredicate check to filter out null and empty strings.
 
- 
- 
Constructor Details- 
StringUtilsprotected StringUtils()Constructor.
 
- 
- 
Method Details- 
abbreviateAbbreviates a String using ellipses.- Parameters:
- in- The input string.
- length- The max length of the resulting string.
- Returns:
- The abbreviated string.
 
- 
base64DecodeBASE64-decodes the specified string.- Parameters:
- in- The BASE-64 encoded string.
- Returns:
- The decoded byte array, or null if the input was null .
 
- 
base64DecodeToStringShortcut for callingbase64Decode(String) and converting the result to a UTF-8 encoded string.- Parameters:
- in- The BASE-64 encoded string to decode.
- Returns:
- The decoded string.
 
- 
base64EncodeBASE64-encodes the specified byte array.- Parameters:
- in- The input byte array to convert.
- Returns:
- The byte array converted to a BASE-64 encoded string.
 
- 
base64EncodeToStringShortcut for callingbase64Encode(in.getBytes("UTF-8" ))- Parameters:
- in- The input string to convert.
- Returns:
- The string converted to BASE-64 encoding.
 
- 
charAtReturns the character at the specified index in the string without throwing exceptions.- Parameters:
- s- The string.
- i- The index position.
- Returns:
- The character at the specified index, or 0 if the index is out-of-range or the string isnull .
 
- 
compareCompares two strings, but gracefully handlesnulls .- Parameters:
- s1- The first string.
- s2- The second string.
- Returns:
- The same as String.compareTo(String).
 
- 
compressConverts string into a GZipped input stream.- Parameters:
- contents- The contents to compress.
- Returns:
- The input stream converted to GZip.
- Throws:
- Exception- Exception occurred.
 
- 
containsSame asString.contains(CharSequence)except returnsnull if the value is null.- Parameters:
- value- The string to check.
- substring- The value to check for.
- Returns:
- true if the value contains the specified substring.
 
- 
containsAnyReturnstrue if the specified string contains any of the specified characters.- Parameters:
- s- The string to test.
- chars- The characters to look for.
- Returns:
- true if the specified string contains any of the specified characters.- false if the string is- null .
 
- 
countCharsCounts the number of the specified character in the specified string.- Parameters:
- s- The string to check.
- c- The character to check for.
- Returns:
- The number of those characters or zero if the string was null .
 
- 
decodeHexDebug method for rendering non-ASCII character sequences.- Parameters:
- s- The string to decode.
- Returns:
- A string with non-ASCII characters converted to "[hex]" sequences.
 
- 
decompressConverts a GZipped input stream into a string.- Parameters:
- is- The contents to decompress.
- Returns:
- The string.
- Throws:
- Exception- Exception occurred.
 
- 
diffPositionFinds the position where the two strings differ.- Parameters:
- s1- The first string.
- s2- The second string.
- Returns:
- The position where the two strings differ, or -1 if they're equal.
 
- 
diffPositionIcFinds the position where the two strings differ ignoring case.- Parameters:
- s1- The first string.
- s2- The second string.
- Returns:
- The position where the two strings differ, or -1 if they're equal.
 
- 
endsWithAn efficient method for checking if a string ends with a character.- Parameters:
- s- The string to check. Can be- null .
- c- The character to check for.
- Returns:
- true if the specified string is not- null and ends with the specified character.
 
- 
endsWithSame asendsWith(String, char)except check for multiple characters.- Parameters:
- s- The string to check. Can be- null .
- c- The characters to check for.
- Returns:
- true if the specified string is not- null and ends with the specified character.
 
- 
escapeCharsEscapes the specified characters in the string.- Parameters:
- s- The string with characters to escape.
- escaped- The characters to escape.
- Returns:
- The string with characters escaped, or the same string if no escapable characters were found.
 
- 
firstCharReturns the first character in the specified string.- Parameters:
- s- The string to check.
- Returns:
- The first character in the string, or 0 if the string isnull or empty.
 
- 
firstNonEmptyReturns the first non-null, non-empty string in the list.- Parameters:
- s- The strings to test.
- Returns:
- The first non-empty string in the list, or null if they were allnull or empty.
 
- 
firstNonWhitespaceCharReturns the first non-whitespace character in the string.- Parameters:
- s- The string to check.
- Returns:
- The first non-whitespace character, or 0 if the string isnull , empty, or composed of only whitespace.
 
- 
fixUrlAttempts to escape any invalid characters found in a URI.- Parameters:
- in- The URI to fix.
- Returns:
- The fixed URI.
 
- 
formatSimilar toMessageFormat.format(String, Object...)except allows you to specify POJO arguments.- Parameters:
- pattern- The string pattern.
- args- The arguments.
- Returns:
- The formatted string.
 
- 
fromHexConverts a hexadecimal character string to a byte array.- Parameters:
- hex- The string to convert to a byte array.
- Returns:
- A new byte array.
 
- 
fromHexToUTF8Converts a hexadecimal byte stream (e.g. "34A5BC") into a UTF-8 encoded string.- Parameters:
- hex- The hexadecimal string.
- Returns:
- The UTF-8 string.
 
- 
fromSpacedHexSame asfromHex(String)except expects spaces between the byte strings.- Parameters:
- hex- The string to convert to a byte array.
- Returns:
- A new byte array.
 
- 
fromSpacedHexToUTF8Converts a space-deliminted hexadecimal byte stream (e.g. "34 A5 BC") into a UTF-8 encoded string.- Parameters:
- hex- The hexadecimal string.
- Returns:
- The UTF-8 string.
 
- 
getAuthorityUriGiven an absolute URI, returns just the authority portion (e.g."http://hostname:port" )- Parameters:
- s- The URI string.
- Returns:
- Just the authority portion of the URI.
 
- 
getDurationParses a duration string.Examples: - "1000" - 1000 milliseconds.
- "10s" - 10 seconds.
- "10 sec" - 10 seconds.
- "10 seconds" - 10 seconds.
 Use any of the following suffixes: - None (time in milliseconds).
- "s" /- "sec" /- "second" /- "seconds" 
- "m" /- "min" /- "minutes" /- "seconds" 
- "h" /- "hour" /- "hours" 
- "d" /- "day" /- "days" 
- "w" /- "week" /- "weeks" 
 Suffixes are case-insensitive. 
 Whitespace is ignored.- Parameters:
- s- The string to parse.
- Returns:
- The time in milliseconds, or -1 if the string is empty ornull .
 
- 
getNumberedLinesTakes in a string, splits it by lines, and then prepends each line with line numbers.- Parameters:
- s- The string.
- Returns:
- The string with line numbers added.
 
- 
getNumberedLinesSame asgetNumberedLines(String)except only returns the specified lines.Out-of-bounds values are allowed and fixed. - Parameters:
- s- The string.
- start- The starting line (1-indexed).
- end- The ending line (1-indexed).
- Returns:
- The string with line numbers added.
 
- 
indexOfSame asString.indexOf(int)except allows you to check for multiple characters.- Parameters:
- s- The string to check.
- c- The characters to check for.
- Returns:
- The index into the string that is one of the specified characters.
 
- 
isAbsoluteUriEfficiently determines whether a URL is of the pattern "xxx://xxx"- Parameters:
- s- The string to test.
- Returns:
- true if it's an absolute path.
 
- 
isDecimalReturnstrue if the specified string is numeric.- Parameters:
- s- The string to check.
- Returns:
- true if the specified string is numeric.
 
- 
isFirstNumberCharReturnstrue if the specified character is a valid first character for a number.- Parameters:
- c- The character to test.
- Returns:
- true if the specified character is a valid first character for a number.
 
- 
isFloatReturnstrue if the specified string is a floating point number.- Parameters:
- s- The string to check.
- Returns:
- true if the specified string is a floating point number.
 
- 
isJsonReturnstrue if the specified string is valid JSON.Leading and trailing spaces are ignored. 
 Leading and trailing comments are not allowed.- Parameters:
- s- The string to test.
- Returns:
- true if the specified string is valid JSON.
 
- 
isJsonArrayReturnstrue if the specified string appears to be an JSON array.- Parameters:
- o- The object to test.
- ignoreWhitespaceAndComments- If- true , leading and trailing whitespace and comments will be ignored.
- Returns:
- true if the specified string appears to be a JSON array.
 
- 
isJsonObjectReturnstrue if the specified string appears to be a JSON object.- Parameters:
- o- The object to test.
- ignoreWhitespaceAndComments- If- true , leading and trailing whitespace and comments will be ignored.
- Returns:
- true if the specified string appears to be a JSON object.
 
- 
isNumberCharReturnstrue if the specified character is a valid number character.- Parameters:
- c- The character to check.
- Returns:
- true if the specified character is a valid number character.
 
- 
isNumericReturnstrue if this string can be parsed byparseNumber(String, Class).- Parameters:
- s- The string to check.
- Returns:
- true if this string can be parsed without causing an exception.
 
- 
isOneOfReturnstrue if the specified string is one of the specified values.- Parameters:
- s- The string to test. Can be- null .
- values- The values to test. Can contain- null .
- Returns:
- true if the specified string is one of the specified values.
 
- 
isUriEfficiently determines whether a URL is of the pattern "xxx:/xxx".The pattern matched is: [a-z]{2,}\:\/.* Note that this excludes filesystem paths such as "C:/temp" .- Parameters:
- s- The string to test.
- Returns:
- true if it's an absolute path.
 
- 
joineSame asUtils.join(Collection, char)but escapes the delimiter if found in the tokens.- Parameters:
- tokens- The tokens to join.
- d- The delimiter.
- Returns:
- The delimited string.  If tokens isnull , returnsnull .
 
- 
lastNonWhitespaceCharReturns the last non-whitespace character in the string.- Parameters:
- s- The string to check.
- Returns:
- The last non-whitespace character, or 0 if the string isnull , empty, or composed of only whitespace.
 
- 
parseCharacterConverts aString to aCharacter - Parameters:
- o- The string to convert.
- Returns:
- The first character of the string if the string is of length 1, or null if the string isnull or empty.
- Throws:
- IllegalArgumentException- If the string length is not 1.
 
- 
parseIntWithSuffixConverts a string containing a possible multiplier suffix to an integer.The string can contain any of the following multiplier suffixes: - "K" - x 1024
- "M" - x 1024*1024
- "G" - x 1024*1024*1024
- "k" - x 1000
- "m" - x 1000*1000
- "g" - x 1000*1000*1000
 - Parameters:
- s- The string to parse.
- Returns:
- The parsed value.
 
- 
parseIsoCalendarParses an ISO8601 string into a calendar.Supports any of the following formats: yyyy, yyyy-MM, yyyy-MM-dd, yyyy-MM-ddThh, yyyy-MM-ddThh:mm, yyyy-MM-ddThh:mm:ss, yyyy-MM-ddThh:mm:ss.SSS - Parameters:
- date- The date string.
- Returns:
- The parsed calendar.
- Throws:
- IllegalArgumentException- Value was not a valid date.
 
- 
parseIsoDateParses an ISO8601 string into a date.Supports any of the following formats: yyyy, yyyy-MM, yyyy-MM-dd, yyyy-MM-ddThh, yyyy-MM-ddThh:mm, yyyy-MM-ddThh:mm:ss, yyyy-MM-ddThh:mm:ss.SSS - Parameters:
- date- The date string.
- Returns:
- The parsed date.
- Throws:
- IllegalArgumentException- Value was not a valid date.
 
- 
parseLongWithSuffixConverts a string containing a possible multiplier suffix to a long.The string can contain any of the following multiplier suffixes: - "K" - x 1024
- "M" - x 1024*1024
- "G" - x 1024*1024*1024
- "T" - x 1024*1024*1024*1024
- "P" - x 1024*1024*1024*1024*1024
- "k" - x 1000
- "m" - x 1000*1000
- "g" - x 1000*1000*1000
- "t" - x 1000*1000*1000*1000
- "p" - x 1000*1000*1000*1000*1000
 - Parameters:
- s- The string to parse.
- Returns:
- The parsed value.
 
- 
parseNumberParses a number from the specified string.- Parameters:
- s- The string to parse the number from.
- type- The number type to created. Can be any of the following:- Integer
- Double
- Float
- Long
- Short
- Byte
- BigInteger
- BigDecimal
 - null or- Number , uses the best guess.
- Returns:
- The parsed number, or null if the string was null.
 
- 
randomGenerated a random UUID with the specified number of characters.Characters are composed of lower-case ASCII letters and numbers only. This method conforms to the restrictions for hostnames as specified in RFC 952 Since each character has 36 possible values, the square approximation formula for the number of generated IDs that would produce a 50% chance of collision is: sqrt(36^N) . Dividing this number by 10 gives you an approximation of the number of generated IDs needed to produce a <1% chance of collision.For example, given 5 characters, the number of generated IDs need to produce a <1% chance of collision would be: sqrt(36^5)/10=777 - Parameters:
- numchars- The number of characters in the generated UUID.
- Returns:
- A new random UUID.
 
- 
repeatCreates a repeated pattern.- Parameters:
- count- The number of times to repeat the pattern.
- pattern- The pattern to repeat.
- Returns:
- A new string consisting of the repeated pattern.
 
- 
replaceUnicodeSequencesReplaces"\\uXXXX" character sequences with their unicode characters.- Parameters:
- s- The string to replace unicode sequences in.
- Returns:
- A string with unicode sequences replaced.
 
- 
replaceVarsSimple utility for replacing variables of the form"{key}" with values in the specified map.Nested variables are supported in both the input string and map values. If the map does not contain the specified value, the variable is not replaced. null values in the map are treated as blank strings.- Parameters:
- s- The string containing variables to replace.
- m- The map containing the variable values.
- Returns:
- The new string with variables replaced, or the original string if it didn't have variables in it.
 
- 
startsWithAn efficient method for checking if a string starts with a character.- Parameters:
- s- The string to check. Can be- null .
- c- The character to check for.
- Returns:
- true if the specified string is not- null and starts with the specified character.
 
- 
stringifyDeepConverts the specified array to a string.- Parameters:
- o- The array to convert to a string.
- Returns:
- The array converted to a string, or null if the object was null.
 
- 
stripStrips the first and last character from a string.- Parameters:
- s- The string to strip.
- Returns:
- The striped string, or the same string if the input was null or less than length 2.
 
- 
stripInvalidHttpHeaderCharsStrips invalid characters such as CTRL characters from a string meant to be encoded as an HTTP header value.- Parameters:
- s- The string to strip chars from.
- Returns:
- The string with invalid characters removed.
 
- 
toCdlConverts the specified object to a comma-delimited list.- Parameters:
- o- The object to convert.
- Returns:
- The specified object as a comma-delimited list.
 
- 
toHexConverts the specified byte into a 2 hexadecimal characters.- Parameters:
- b- The number to convert to hex.
- Returns:
- A char [2]
 
- 
toHexConverts a byte array into a simple hexadecimal character string.- Parameters:
- bytes- The bytes to convert to hexadecimal.
- Returns:
- A new string consisting of hexadecimal characters.
 
- 
toHexConverts the contents of the specified input stream to a hex string.- Parameters:
- is- The input stream to convert.
- Returns:
- The hex string representation of the input stream contents, or null if the stream isnull .
 
- 
toHex2Converts the specified number into a 2 hexadecimal characters.- Parameters:
- num- The number to convert to hex.
- Returns:
- A char [2]
 
- 
toHex4Converts the specified number into a 4 hexadecimal characters.- Parameters:
- num- The number to convert to hex.
- Returns:
- A char [4]
 
- 
toHex8Converts the specified number into a 8 hexadecimal characters.- Parameters:
- num- The number to convert to hex.
- Returns:
- A char [8]
 
- 
toIsoDateConverts the specified object to an ISO8601 date string.- Parameters:
- c- The object to convert.
- Returns:
- The converted object.
 
- 
toIsoDateTimeConverts the specified object to an ISO8601 date-time string.- Parameters:
- c- The object to convert.
- Returns:
- The converted object.
 
- 
toReadableBytesConverts the specified bytes into a readable string.- Parameters:
- b- The number to convert to hex.
- Returns:
- A char [2]
 
- 
toSpacedHexSame astoHex(byte[])but puts spaces between the byte strings.- Parameters:
- bytes- The bytes to convert to hexadecimal.
- Returns:
- A new string consisting of hexadecimal characters.
 
- 
toURIConverts the specified object to a URI.- Parameters:
- o- The object to convert to a URI.
- Returns:
- A new URI, or the same object if the object was already a URI, or
 
- 
toUtf8Converts the specified byte array to a UTF-8 string.- Parameters:
- b- The byte array to convert.
- Returns:
- The UTF-8 string representation, or null if the array isnull .
 
- 
toUtf8Converts the contents of the specified input stream to a UTF-8 string.- Parameters:
- is- The input stream to convert.
- Returns:
- The UTF-8 string representation of the input stream contents, or null if the stream isnull .
 
- 
trimSame asString.trim()but preventsNullPointerExceptions .- Parameters:
- s- The string to trim.
- Returns:
- The trimmed string, or null if the string wasnull .
 
- 
trimEndTrims whitespace characters from the end of the specified string.- Parameters:
- s- The string to trim.
- Returns:
- The trimmed string, or null if the string wasnull .
 
- 
trimLeadingSlashesTrims'/' characters from the beginning of the specified string.- Parameters:
- s- The string to trim.
- Returns:
- A new trimmed string, or the same string if no trimming was necessary.
 
- 
trimSlashesTrims'/' characters from both the start and end of the specified string.- Parameters:
- s- The string to trim.
- Returns:
- A new trimmed string, or the same string if no trimming was necessary.
 
- 
trimSlashesAndSpacesTrims'/' and space characters from both the start and end of the specified string.- Parameters:
- s- The string to trim.
- Returns:
- A new trimmed string, or the same string if no trimming was necessary.
 
- 
trimStartTrims whitespace characters from the beginning of the specified string.- Parameters:
- s- The string to trim.
- Returns:
- The trimmed string, or null if the string wasnull .
 
- 
trimTrailingSlashesTrims'/' characters from the end of the specified string.- Parameters:
- s- The string to trim.
- Returns:
- A new trimmed string, or the same string if no trimming was necessary.
 
- 
unEscapeCharsRemoves escape characters from the specified characters.- Parameters:
- s- The string to remove escape characters from.
- escaped- The characters escaped.
- Returns:
- A new string if characters were removed, or the same string if not or if the input was null .
 
- 
unicodeSequenceCreates an escaped-unicode sequence (e.g."\\u1234" ) for the specified character.- Parameters:
- c- The character to create a sequence for.
- Returns:
- An escaped-unicode sequence.
 
- 
urlDecodeDecodes aapplication/x-www-form-urlencoded string usingUTF-8 encoding scheme.- Parameters:
- s- The string to decode.
- Returns:
- The decoded string, or null if input isnull .
 
- 
urlEncodeEncodes aapplication/x-www-form-urlencoded string usingUTF-8 encoding scheme.- Parameters:
- s- The string to encode.
- Returns:
- The encoded string, or null if input isnull .
 
- 
urlEncodeLaxSame asurlEncode(String)except only escapes characters that absolutely need to be escaped.- Parameters:
- s- The string to escape.
- Returns:
- The encoded string, or null if input isnull .
 
- 
urlEncodePathSimilar toURLEncoder.encode(String, String)but doesn't encode"/" characters.- Parameters:
- o- The object to encode.
- Returns:
- The URL encoded string, or null if the object was null.
 
 
-