Code
String str = "hello";
byte [] x = str.getBytes ();
System.out.println ( new String (x) );
String byStr = "104, 101, 108, 108, 111";
String a [] = byStr.split ( "," );
byte xx [] = new byte[a.length];
int count = 0;
for ( String s : a)
{
xx[count++] = Byte.parseByte ( s.trim () );
}
System.out.println ( new String (xx) );
byte [] x = str.getBytes ();
System.out.println ( new String (x) );
String byStr = "104, 101, 108, 108, 111";
String a [] = byStr.split ( "," );
byte xx [] = new byte[a.length];
int count = 0;
for ( String s : a)
{
xx[count++] = Byte.parseByte ( s.trim () );
}
System.out.println ( new String (xx) );
Output
hello
hello