Package org.marketcetera.util.misc
Class StringUtils
- java.lang.Object
-
- org.marketcetera.util.misc.StringUtils
-
public final class StringUtils extends Object
Utilities for string management.- Since:
- 0.6.0
- Version:
- $Id: StringUtils.java 16154 2012-07-14 16:34:05Z colin $
- Author:
- tlerios@marketcetera.com
-
-
Constructor Summary
Constructors Modifier Constructor Description privateStringUtils()Constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringfromUCP(int ucp)Returns a string containing a single character, namely the given Unicode code point.static StringfromUCP(int[] ucps)Returns a string containing the characters with the given Unicode code points.static booleanisValid(int ucp)Checks whether the given integer represents a well-defined unicode code point that is also not an ISO control character or within the surrogate areas (high or low).static intlengthUCP(String s)Returns the number of Unicode code points in the given string.static int[]toUCPArray(String s)Returns an array containing the Unicode code points of the given string.static StringtoUCPArrayStr(String s)Returns a string containing the integer representations, in uppercase hex, of the Unicode code points of the given string.
-
-
-
Method Detail
-
lengthUCP
public static int lengthUCP(String s)
Returns the number of Unicode code points in the given string.- Parameters:
s- The string.- Returns:
- The number of Unicode code points.
-
fromUCP
public static String fromUCP(int[] ucps)
Returns a string containing the characters with the given Unicode code points.- Parameters:
ucps- The code points.- Returns:
- The string.
-
fromUCP
public static String fromUCP(int ucp)
Returns a string containing a single character, namely the given Unicode code point.- Parameters:
ucp- The code point.- Returns:
- The string.
-
toUCPArray
public static int[] toUCPArray(String s)
Returns an array containing the Unicode code points of the given string.- Parameters:
s- The string. It may be null, in which case null is returned.- Returns:
- The code points.
-
toUCPArrayStr
public static String toUCPArrayStr(String s)
Returns a string containing the integer representations, in uppercase hex, of the Unicode code points of the given string.- Parameters:
s- The input string. It may be null, in which case null is returned.- Returns:
- The resulting string.
-
isValid
public static boolean isValid(int ucp)
Checks whether the given integer represents a well-defined unicode code point that is also not an ISO control character or within the surrogate areas (high or low).- Parameters:
ucp- The integer (candidate code point).- Returns:
- True if so.
-
-