I am using StringTokenizer to tokenize a string with $$ as delimeter but if my string is like $1$dga74 then it tokenize this from first $. Can any body tell me why this happens and what can I do to remove this issue.
String str="/getCPage.asp?m=total&sub=$1$dga74$$/getEpage.asp?m=tatal&sub=0";
StringTokenizer tok=new StringTokenizer(str,"$$")
String url1=tok.nextToken();
String url2=tok.nextToken();
Each character in the
delimargument is treated as a delimiter character. If you specify"$$"you specify$twice (the second is ignored).To solve your problem you can use a
Scanner:Outputs: