package com.bill.example;
public class StringByteArrayExamples
{
public static void main(String[] args)
{
//Original String
String string = "hello world";
//Convert to byte[]
byte[] bytes = string.getBytes();
//Convert back to String
String s = new String(bytes);
//Check converted string against original String
System.out.println("Decoded String : " + s);
}
}
byte[]转换成String
最新推荐文章于 2024-05-19 18:00:00 发布