GENESIS Reference ManualMay 5, 2001: String Manipulation Routines

Previous Next Table of Contents

## 6. String Manipulation Routines

The following table lists the basic GENESIS routines for working with text strings (i.e., variables declared as type str, or text enclosed in quotes).

Routine | Description
chr | Returns ASCII character specified by number code.
countchar | Counts occurrences of specified character in string.
findchar | Returns location of specified character in a given string.
strcat | Returns new string as concatenation of two strings. *
strcmp | Compares two strings. **
strlen | Returns length of string in number of characters.
strncmp | Compares two strings up to specified number of characters. **
strsub | Returns a string with one substring replaced by another.
substring | Returns part of original string as new substring.

* You can also concatenate strings using the GENESIS ``@'' operator. ** You can also compare strings using the GENESIS relational operators

The getpath command with the `-head` and `-tail` options is often used with the commands listed above in order to get element names or partial path names.

Previous Next Table of Contents