Java StringTokenizer - delim format -
where can stringtokenizer delim format?
for example had string:
tokens = new stringtokenizer(s.nextline(), "-|\\+|/|\\*", true);
after few attempts add \\
, expression start works, don't know why should escape symbols, in stringtokenizer reference no info that.
escaping '\' character consequence of using in any string (or char
). doesn't have stringtokenizer.
why see nothing escaping back-slash ('\').
string x = "windows likes using '\\' in path info."; system.out.println(x);
gives
windows likes using '\' in path info.
similarly
char c = '\\'; system.out.println("c = " + c);
gives
c = \
so fact giving '\' delimiter string argument of stringtokenizer forces escape back-slash.
Comments
Post a Comment