I thought I could ask here instead of making a new
thread. I'll make a new thread if I get no response :/
I still don't understand the concept.
I wrote this little program:
Here are few of the outputs from the following command line invocations:
1) With
java LogSplitter "a" "\w"
Output:
0
2) With java LogSplitter "a " "\w"
Output:
><> <
2
Now, why does the second invocation return an empty token between -1 and 0 along with space following a in "a "
and the first invocation doesn't return an empty invocation between -1 and 0?
3) Although with java LogSplitter "a" "\d"
Output is:
>a<
1
why does it return the token >a< even when there's no digit in the
string? And it returned 0 in the first invocation?
4) With java LogSplitter "" "\w"
Output:
><
1
why does it return an empty string when there's nothing in the string?
5) With java LogSplitter " a" "\s"
Output:
><><>a<
3
What's up when using "\s"?
WHAT IS THE LOGIC BEHIND SPLIT?