I'm trying to split() a String with no whitespaces, but getting a blank at [0].
String s = "..1..3..";
String[] result2 = s.split("");
System.out.println(result2[0]); // giving me a blank space
I'v realized that "" might not be the right one, but cant find a alternative. Is it possible to split on something else, or will I always get this whitespace when using split() this way?
EDIT SOLUTION:
StringBuilder response = new StringBuilder();
while((i = in.read()) != -1){
response.append((char)i);
}
result = response.toString();
result = result.replace("\n", "").replace("\r", "");