集册 Java实例教程 将字符串转换为字节数组

将字符串转换为字节数组

欢马劈雪     最近更新时间:2020-01-02 10:19:05

380
将字符串转换为字节数组


public class Main {

        public static void main(String args[]){

                String str = "Hello World";
                /*
                来 自*
                 时代Java公众号 - nowjava.com
                */

               

                byte[] bytes = str.getBytes();

        }

}