my_array=String1.getBytes()
Return value is an array of bytes String my_str="abcd";
byte[] my_array=my_str.getBytes();
for(int i=0;i<my_array.length;i++) {
System.out.println(my_array[i]);
}
Output is here
97
98
99
100
All String functions