Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[T2A2][W14-A3] Loh Zi Bin, Robin #311

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

robinloh
Copy link

No description provided.

Copy link

@K1ang K1ang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robinloh Some comments added. Please close the PR after reading comments.

  • There are many more refactoring that can be done here. Do practice if you can!

@@ -394,8 +425,8 @@ private static String executeCommand(String userInputString) {
* @return size 2 array; first element is the command type and second element is the arguments string
*/
private static String[] splitCommandWordAndArgs(String rawUserInput) {
final String[] split = rawUserInput.trim().split("\\s+", 2);
return split.length == 2 ? split : new String[] { split[0] , "" }; // else case: no parameters
final String[] split = rawUserInput.trim().split("\\s+", TWO);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about the magic string for the regex here?

@K1ang K1ang added the Reviewed label Feb 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants