This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
String input = "1 fish 2 fish red fish blue fish";
Scanner s = new Scanner(input).useDelimiter("\\s*fish\\s*");
output is :
Can anyone help me in understanding how the output has come? I have not understood the core thing:
" ("\\s*fish\\s*"); "
what is the meaning of \s,\d??
I have taken a look and tried some examples. So in the above example:
This string is treated as the delimiter: "zero or more times white space, then word fish, then zero or more white spaces".
Am I right?