[Top] [Prev] [Next]

string: append, drop, in, prefix, splitl, splitr, splitstrl, splitstrr, take, toint, tolower, toupper - string operations

include "string.m";
str:= load String String->PATH;
append:    fn(s: string, l: list of string): list of string;
drop:      fn(s, cl: string)               : string;
in:        fn(c: int, cl: string)          : int;
prefix:    fn(pre, s: string)              : int;
splitl:    fn(s, cl: string)             : (string, string);
splitr:    fn(s, cl: string)             : (string, string);
splitstrl: fn(s,  t: string)             : (string, string);
splitstrr: fn(s,  t: string)             : (string, string);
take:      fn(s, cl: string)               : string;
toint:     fn(s: string, base: int)        : (int, string);
tolower:   fn(s: string)                   : string;
toupper:   fn(s: string)                   : string;

Description

The cl argument to some of these functions is a character class in which a minus sign (-) between any two characters indicates a range and a circumflex (^) in the first position means not in the class. Examples of strings that represent character classes are "a-zA-Z" and "^acg-mr".
append (s, l)

Appends string s to the end of string list l.

drop (s, cl)

Removes the maximal prefix of string s that is in class cl.

in (c, cl)

Returns a 1 if c is in class cl and a 0 if it is not.

prefix (pre, s)

Returns a 1 if string pre is a prefix of string s and a 0 if it is not.

splitl (s, cl)

Splits string s just before the first character in class cl.

splitr (s, cl)

Splits string s just after the last character in class cl.

splitstrl (s, t)

Splits string s just before the initial segment of string s which consists entirely of string t.

splitstrr (s, t)

Splits string s just after the last segment of string s which consists entirely of string t.

take (s, cl)

Returns the maximal prefix of string s that is in class cl.

toint (s, base)

Returns as an integer the value represented by the string s. The string is scanned up to the first character inconsistent with base. The first inconsistent character marks the beginning of the returned string. Leading white-space characters are ignored. The base can be any integer in the range 0 to 36, inclusive.

tolower (s)

Converts all upper case letters in the string s to lower case letters.

toupper (s)

Converts all lower case letters in the string s to upper case letters.



[Top] [Prev] [Next]

infernosupport@lucent.com
Copyright © 1996,Lucent Technologies, Inc. All rights reserved.