i'm new in Java/Android. I create an array like this:
String [] resultArray = new String [lengthFromServ];
int i = 0;
while (i<lengthFromServ) {
int result = fromServ.read();
char valueOfResult = (char) result;
String resultFromServ = Character.toString(valueOfResult);
resultArray[i] = resultFromServ;
i++;
}
lengthFromServ is declared before:(while statement executes 4 times)
lengthFromServ = 4;
Serwer send me string: "0,12"
When I try print elements of this array by:
System.out.println(Arrays.toString(resultArray))
I get:
[0, ,, 1, 2]
My question is: how can I get only elements of this array ? Without "["
, "]"
, ","
? I just want to get this string:
0,12
Please help, I would be grateful for any help.