Quick start manual
Standard routines and I/O
8-7
Handling null-terminated strings
Standard string-handling functions have multibyte-enabled counterparts that also
implement locale-specific ordering for characters. Names of multibyte functions start
with Ansi-. For example, the multibyte version of StrPos is AnsiStrPos. Multibyte
character support is operating-system dependent and based on the current locale.
Wide-character strings
The System unit provides three functions, WideCharToString, WideCharLenToString,
and StringToWideChar, that can be used to convert null-terminated wide character
strings to single- or double-byte long strings.
Assignment will also convert between strings. For instance, the following are both
valid:
MyAnsiString := MyWideString;
MyWideString := MyAnsiString;
For more information about wide-character strings, see “About extended character
sets” on page 5-13.
StrCopy Copies a string.
StrDispose Disposes a character buffer allocated using StrAlloc or StrNew.
StrECopy Copies a string and returns a pointer to the end of the string.
StrEnd Returns a pointer to the end of a string.
StrFmt Formats one or more values into a string.
StrIComp Compares two strings without case sensitivity.
StrLCat Concatenates two strings with a given maximum length of the resulting string.
StrLComp Compares two strings for a given maximum length.
StrLCopy Copies a string up to a given maximum length.
StrLen Returns the length of a string.
StrLFmt Formats one or more values into a string with a given maximum length.
StrLIComp Compares two strings for a given maximum length without case sensitivity.
StrLower Converts a string to lowercase.
StrMove Moves a block of characters from one string to another.
StrNew Allocates a string on the heap.
StrPCopy Copies a Pascal string to a null-terminated string.
StrPLCopy Copies a Pascal string to a null-terminated string with a given maximum length.
StrPos Returns a pointer to the first occurrence of a given substring within a string.
StrRScan Returns a pointer to the last occurrence of a given character within a string.
StrScan Returns a pointer to the first occurrence of a given character within a string.
StrUpper Converts a string to uppercase.
Table 8.2 Null-terminated string functions (continued)
Function Description