I have a large string, similar to this one:
BREW pot HTCPCP/1.0
Accept-Additions: #milk;3#whiskey;splash
Content-Length: 5
Content-Type: message/coffeepot
I also have an array with several additions (#whiskey, #espresso, etc). What I need to do is send an error if this large string contains an addition that is NOT in the array of available additions. For example, if the "Accept-Additions" part of the string contained "#bricks;3" an error was produced as it is not in the array.
How would I go about this in Java? I'm having trouble implementing this part, although I've coded the rest of the program (which many of you may recognise). How would I code the following problem, with emphasis on the addition not being available?