字符转16进制

 1 package com.charles.utils;
 2 
 3 public class String2Hex {
 4 
 5     public static void main(String[] args) {
 6 
 7         String param = "ccbfc13e-c31d-42ce-8939-3c7e63ed5417";
 8         //63636266633133652d633331642d343263652d383933392d336337653633656435343137
 9         convertString2Hex(param);
10     }
11 
12     private static void convertString2Hex(String param) {
13         if(null == param || 0 == param.length()){
14             return;
15         }
16         for (int index = 0, length = param.length(); index < length; index++) {
17             Integer data = param.codePointAt(index);
18             System.out.print(Integer.toHexString(data));
19         }
20     }
21 
22 }
原文地址:https://www.cnblogs.com/itachy/p/7197568.html