Pascal Scripting: AddPeriod

Prototype

function AddPeriod(const S: String): String;

Description

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.

Remarks

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:

CharacterCode pointDescription
!U+0021Exclamation Mark
.U+002EFull Stop
?U+003FQuestion Mark
։U+0589Armenian Full Stop
؟U+061FArabic Question Mark
۔U+06D4Arabic Full Stop
U+0964Devanagari Danda
U+0965Devanagari Double Danda
U+104AMyanmar Sign Little Section
U+104BMyanmar Sign Section
U+1362Ethiopic Full Stop
U+1367Ethiopic Question Mark
U+17D4Khmer Sign Khan
U+17D5Khmer Sign Bariyoosan
U+17DAKhmer Sign Koomuut
U+3002Ideographic Full Stop
U+FF01Fullwidth Exclamation Mark
U+FF0EFullwidth Full Stop
U+FF1FFullwidth Question Mark

A character is considered Thai or Lao if it is in the range U+0E00 through U+0EFF.

See also

GetExceptionMessage