I am trying to implement a way for taking in arguments for a photo album that I am building. However, I am having a hard time figuring out how to tokenize the input.
Two sample inputs:
addPhoto "DSC_017.jpg" "DSC_017" "Fall colors"
addPhoto "DSC_018.jpg" "DSC_018" "Colorado Springs"
I would like this input to return a String array containing 4 elements where
- String s[1]="addPhoto"
- String s[2]="DSC_017.jpg"
- String s[3]="DSC_017"
- String s[4] = "Fall colors"
I looked into StringTokenizer and String.split but I'm not sure how to go about setting the delimiters.