The Logix system provides seventeen function-like processes,
which are analogous to the C string functions - see
String Handling.
In the descriptions below, the function result is unified with the last argument of the called process.
The Logix processes, with detailed definitions are:
- stripbrk(S1, S2, Iv, Sv)
-
Returns the index to the first instance in S1 of any character in S2, and a
substring of S1, starting with that first instance.
Returns 0 and an empty string if no character from S2 is encountered in S1.
In either case the integer result is unified with variable Iv, and the
string is unified with variable Sv.
- stribrk(S1, S2, Iv)
-
Returns the index to the first instance in S1 of any character in S2.
Returns 0 if no character from S2 is encountered in S1.
In either case the integer result is unified with variable Iv.
- strcat(S1, S2, Sv)
-
Concatenate the string S1 followed by the string S2.
The concatenated string is unified with variable Sv.
- strncat(S1, S2, N, Sv)
-
Concatenate the string S1 followed by at most the first N characters of
the string S2.
The concatenated string is unified with variable Sv.
- strchr(S, C, Sv)
-
Returns the sub-string of S, starting at the first instance of character C.
Returns an empty string if C is not encountered in S.
In either case the result string is unified with variable Sv.
- strrchr(S, C, Sv)
-
Returns the sub-string of S, starting at the last instance of character C.
Returns an empty string if C is not encountered in S.
In either case the result string is unified with variable Sv.
- strcmp(S1, S2, Iv)
-
Compare the string S1 to the string S2.
The integer result is unifed with variable Iv:
Iv = 0 if they are the same
Iv < 0 if S1 is less than S2
Iv > 0 if S1 is greater than S2
- strncmp(S1, S2, N, Iv)
-
Compare up to N characters in the string S1 to the string S2.
The integer result is unified with variable Iv:
Iv = 0 if they are the same
Iv < 0 if S1 is less than S2
Iv > 0 if S1 is greater than S2
- strcpy(S1, S2, Sv)
-
Copy the string S2 to variable S1.
S1 is unified with variable Sv.
- strncpy(S1, S2, N, Sv)
-
Copy at most N characters of the string S2 to variable S1.
S1 is unified with variable Sv.
- strspn(S1, S2, Iv)
-
Returns the length of the longest substring of S1 that begins at the start
of S1 and consists only of the characters found in string S2.
The integer result is unified with variable Iv.
- strcspn(S1, S2, Iv)
-
Returns the length of the longest substring of S1 that begins at the start
of S1 and consists only of the characters not found in string S2.
The integer result is unified with variable Iv.
- stristr(S1, S2, Iv)
-
Returns the index to S1 of the first substring of S1 which matches S2.
Returns 0 if S2 does not match any substring of S1.
In either case the integer result is unified with Iv.
- strpstr(S1, S2, Sv)
-
Returns the first substring of S1, whose front end matches string S2,
followed by any trailing characters.
Returns an empty string if S2 does not match any substring of S1.
The result string is unified with variable Sv.
- strlen(S1, Iv)
-
Returns the length of string S.
The integer result is unified with variable Iv.
- strtok(S1, S2, Sv)
-
Successive calls to this function extract successive tokens
from string S1.
Each token is separated from its successor (if any) by one or more
separators.
Each character in S2 is a separator (The string S1 may end with a separator.
The initial call accepts string S1 and produces a channel:
strtok(S1, CHv)
The channel is unified with variable CHv.
Subsequent calls use the channel as the first argument.
Subsequent calls have the forms:
strtok(CH, S2, Tv)
strtok({CH, CH'}, S2, Tv)
The next token is returned; an empty string is returned if there
are no more tokens.
In either case the result string is unified with variable Tv.