I am working on a command based feature for a project in Java and am having trouble when introducing arguments to these commands.
For example all the commands are stored like this this:
"Hey tell [USER] to [ACTION]"
Now when the user submits their command it will look like this:
"Hey tell Player to come see me"
Now I need to know how I can compare the users inputted command to the stored command containing placeholder values. I need to be able to compare the two strings and recognise that they are the same command and then from this extract the data [USER] and [ACTION] and return them as an array
array[0] = "Player"
array[1] = "come see me"
Really hope somebody can help me out, thanks