How to remove last white space from the string. I am reading the html code. here I want to read only 'Remove a Speed Dial: Tap the'. This is my expected output. In my code I used the trim() also. but by using below code, I am getting output as 'Remove a Speed Dial: Tap the '
in html text is "Remove a Speed Dial: Tap the "
String str = new String(data);
System.out.println(Arrays.toString(data));
System.out.println(str.trim());
output:
[R, e, m, o, v, e, , a, , S, p, e, e, d, , D, i, a, l, :, , T, a, p, , t, h, e, ]
Remove a Speed Dial: Tap the