Salve a tutti,
mi sapete dire come convertire un vettore di byte in una stringa, eliminando gli spazi?
Vi posto il codice che ho scritto:
Grazie,codice:public String getText(byte [] readed , int Bytes){ System.out.println("SONO DENTRO IL METODO GETTEXT()"); String str=""; int i; for(i=0;i<Bytes;i++){ System.out.println(i); if(!Character.isWhitespace((char)readed[i])){ str=new String (readed[i]); } } System.out.println(str); return str; }
Cristian (TAURUS)

Rispondi quotando