You could use .split("")
on the input string to split it into an array of strings where each element in the array was a word in your original string. In other words
"ADD C She".split("") = {"ADD", "C", "She"}
Once you have an array you can easily check element 1 for the command name with a switch statement, element 2 for the file name, and element 3 for the argument.