HOW to get the spaces out of a delimited string ??
here is a usage scenario where split() seems not to work
and the output is
So as we can see - that the last space that shall be displayed as
[HTML]8the next token -[/HTML] is not displayed.
As far as this space reading from the string in an Array is concerned StringTokenizer fails even miserably. It will not take any of the spaces(either at the start/end or in between)
Is there any way out of it. Sincere thanks in advance.
here is a usage scenario where split() seems not to work
Code:
String origAVNListStr = "~`L~`L~`L~`~`~`L~`"; String[] strArr = origAVNListStr.split("~`"); for(int i=0;i<strArr.length;i++) { System.out.println(i+1 +"the next token - " + strArr[i]); }
Code:
1the next token - 2the next token - L 3the next token - L 4the next token - L 5the next token - 6the next token - 7the next token - L
[HTML]8the next token -[/HTML] is not displayed.
As far as this space reading from the string in an Array is concerned StringTokenizer fails even miserably. It will not take any of the spaces(either at the start/end or in between)
Is there any way out of it. Sincere thanks in advance.
Comment