StringUtils
Path
com.roma.apic.livedata.common.v1.StringUtils
Description
This class is used to convert character strings.
Example
importClass(com.roma.apic.livedata.common.v1.StringUtils); function execute(data){ return StringUtils.toString([97,96,95,94,93,92], "UTF-8") }
Method List
Returned Type |
Method and Description |
---|---|
static String |
toString(byte[] bytes, String encoding) Convert a byte array into a string. |
static String |
toString(byte[] bytes) Convert a byte array into a UTF-8 encoded string. |
static String |
toHexString(byte[] data) Convert a byte array into a hexadecimal lowercase string. |
static byte[] |
hexToByteArray(String hex) Convert a hexadecimal string into a byte array. |
Method Details
- public static String toString(byte[] bytes, String encoding)
Converts a byte array into a string.
Input Parameter
- bytes indicates the byte array to be converted.
- encoding indicates encoding.
Returns
String after conversion.
- public static String toString(byte[] bytes)
Converts a byte array into a UTF-8 encoded string.
Input Parameter
bytes indicates the byte array to be converted.
Returns
String after conversion.
- public static String toHexString(byte[] data)
Converts a byte array into a hexadecimal lowercase string.
Input Parameter
data indicates the byte array to be converted.
Returns
Hexadecimal character string after conversion.
- public static byte[] hexToByteArray(String hex)
Converts a hexadecimal string into a byte array.
Input Parameter
hex indicates the hexadecimal character string to be converted.
Returns
Byte array after conversion.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot