Class StringUtils
java.lang.Object
overit.geocallapp.utilities.datatype.StringUtils
Utility class providing string manipulation and conversion operations.
This class provides utilities for handling string operations that require specific encoding considerations or pattern matching.
This class provides utilities for handling string operations that require specific encoding considerations or pattern matching.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionconvertToSetLong(String stringToFormat, String regex) static StringtruncateStringUTF8(String s, int byteSize) Truncates a string to fit within the specified byte size using UTF-8 encoding.
-
Method Details
-
truncateStringUTF8
Truncates a string to fit within the specified byte size using UTF-8 encoding. This method ensures that the resulting string, when encoded in UTF-8, does not exceed the specified byte limit.- Parameters:
s- the string to truncate (can be null)byteSize- the maximum number of bytes allowed in UTF-8 encoding- Returns:
- the original string if it fits within the byte limit, a truncated version otherwise, or null if input is null
-
convertToSetLong
-