
# StringUtils类说明
#### 路径
com.roma.apic.livedata.common.v1.StringUtils
#### 说明
提供字符串转换功能。
#### 使用示例
```
importClass(com.roma.apic.livedata.common.v1.StringUtils);
function execute(data){
    return StringUtils.toString([97,96,95,94,93,92], "UTF-8")
}
```
#### 方法列表
| 返回类型            | 方法和说明                                                                                                                              |
|:---|:---|
| static String   | [toString](byte\[\] bytes, String encoding) 将字节数组转换为字符串 |
| static String   | [toString](byte\[\] bytes) 将字节数组转换成UTF-8编码字符串         |
| static String   | [toHexString](byte\[\] data) 将字节数组转成十六进制小写字符串            |
| static byte\[\] | [hexToByteArray](String hex) 将十六进制字符串转换成字节数组             |
   
#### 方法详情
- **public static String toString(byte\[\] bytes, String encoding)**
  将字节数组转换为字符串
  **输入参数**
  - bytes：需要转换的字节数组
  
  - encoding：编码
  
  
  **返回信息**
  返回转换后的字符串
  
- **public static String toString(byte\[\] bytes)**
  将字节数组转换成UTF-8编码字符串
  **输入参数**
  bytes：需要转换的字节数组
  **返回信息**
  返回转换后的字符串
  
- **public static String toHexString(byte\[\] data)**
  将字节数组转成十六进制小写字符串
  **输入参数**
  data：需要转换的字节数组
  **返回信息**
  返回转换后的十六进制字符串
  
- **public static byte\[\] hexToByteArray(String hex)**
  将十六进制字符串转换成字节数组
  **输入参数**
  hex：需要转换的十六进制字符串
  **返回信息**
  返回转换后的字节数组
  
 
