In this article, I found the following sentence:
Specifically, Hello, which was
U+006F, will be stored as
48 65 6C 6C 6F, which, behold! is the same as it was stored in ASCII, and ANSI, and every OEM character set on the planet.
The exclamation mark appears in the middle of a sentence, and from the context, it clearly doesn't end the preceding sentence and start a new one. Now consider below:
- Behold this! It is a carrot.
- Behold this! for it is a carrot.
It looks like
1. consists of two sentences, and
2. consists of a single sentence, with the exclamation mark.
Are both these usages correct? What is the rule regarding when an exclamation mark ends a sentence, and when it doesn't?