Modula-2 || Compiler & Tools || Library || Search Engine


Ulm's Modula-2 Library:
Strings


NAME

Strings - simple string operations

SYNOPSIS

PROCEDURE StrLen(s: ARRAY OF CHAR) : CARDINAL;
PROCEDURE StrCat(VAR s1: ARRAY OF CHAR; s2: ARRAY OF CHAR);
PROCEDURE StrCmp(s1, s2: ARRAY OF CHAR) : INTEGER;
PROCEDURE StrCpy(VAR s1: ARRAY OF CHAR; s2: ARRAY OF CHAR);

DESCRIPTION

Strings offers some basic string operations for character arrays. All procedures interpret the first null byte or the end of the array as the end of the string.

StrLen returns the number of leading non-null characters in s.

StrCat appends a copy of string s2 to the end of string s1. Note that the resulting string is silently truncated if it does not fit into s1.

StrCmp compares its arguments and returns an integer greater than, equal to, or less than 0, according as s1 is lexicographically greater than, equal to, or less than s2. Note that the ordering just depends on the ordinal values of the characters and not on local conventions.

StrCpy copies s2 to s1. The result string s1 is silently truncated if s2 does not fit into s1.

SEE ALSO

Conversions number to string conversions
StrSpec more sophisticated string operations
StrToNum string to number conversions

Edited by: borchert, last change: 1997/03/17, revision: 1.3, converted to HTML: 1997/04/28

Modula-2 || Compiler & Tools || Library || Search Engine