I have a scenario where I need to supply users a message. The message can be in the following forms:
- "John likes to eat < b>squirrel< /b>."
- "John likes to eat < b>squirrel< /b> and < b>gator< /b>."
- "John likes to eat < b>squirrel< /b>, < b>gator< /b> and < b>birdpoop< /b>."
- "John likes to eat < b>squirrel< /b>, < b>gator< /b>, < b>birdpoop< /b> and < b>marshmallows< /b>."
- ...
So I think you can see the English pattern here. My question is how do I take an array of things (1...n) that John likes to eat (e.g., squirrel) and turn it dynamically into one of the above English list forms depending upon the number of elements in the array?