I’m learning java and I’m just trying to figure how to go about solving this problem. I have a string ex:
The <object> <verb>, on the <object>.
Every string that contained in <>
(<>
are only for clarification and not in the original string) are keys to a hash map that will return a random value.
I then break the string into an array of strings, and then loop through the array and search the hash map if the key exist return a value, here is where I encounter a problem, in the example above the <verb>
is a key but not <verb>,
(with the comma)
How can I break away from the comma but then return a value with it.
So the end result I don’t need the full code for this, just ideas on how to solve this particular problem.
The dog sat, on the cat.