function AddPeriod(const S: String): String;
Returns the specified string with a . full stop character (U+002E) appended, unless the string is empty, already ends with a sentence-terminating character, ends with a control character (such as CR or LF), or ends with a Thai or Lao character (these do not end sentences with a full stop), in which case the string is returned unchanged.
This function is mainly intended to be used when displaying or logging exception messages, which generally do not end with a punctuation character.
The precise behavior of this function is subject to change. Therefore, callers must not assume that the result will always be the same for a given string. The result is meant to be viewed by humans, not consumed by parsers.
Currently recognized sentence-terminating characters include:
| Character | Code point | Description |
|---|---|---|
| ! | U+0021 | Exclamation Mark |
| . | U+002E | Full Stop |
| ? | U+003F | Question Mark |
| ։ | U+0589 | Armenian Full Stop |
| ؟ | U+061F | Arabic Question Mark |
| ۔ | U+06D4 | Arabic Full Stop |
| । | U+0964 | Devanagari Danda |
| ॥ | U+0965 | Devanagari Double Danda |
| ၊ | U+104A | Myanmar Sign Little Section |
| ။ | U+104B | Myanmar Sign Section |
| ። | U+1362 | Ethiopic Full Stop |
| ፧ | U+1367 | Ethiopic Question Mark |
| ។ | U+17D4 | Khmer Sign Khan |
| ៕ | U+17D5 | Khmer Sign Bariyoosan |
| ៚ | U+17DA | Khmer Sign Koomuut |
| 。 | U+3002 | Ideographic Full Stop |
| ! | U+FF01 | Fullwidth Exclamation Mark |
| . | U+FF0E | Fullwidth Full Stop |
| ? | U+FF1F | Fullwidth Question Mark |
A character is considered Thai or Lao if it is in the range U+0E00 through U+0EFF.