next up previous contents index
Next: Testing strings Up: Using strings Previous: Inserting strings

Substrings

We implement substrings of strings in the following way. Consider the following sequence of commands:

BD>string : A=abcdefghi tex2html_wrap_inline33712

BD>string : B=tuv[A tex2html_wrap_inline33968 3,6]wxyz tex2html_wrap_inline33712

The first command defines a string whose name is `A'. The second command defines a second string, called `B', whose definition part includes a substring extracted from the string whose name is `A'. Indeed, the syntax ` tex2html_wrap_inline34314 ' means that we should replace ` tex2html_wrap_inline34314 ' by the third, fourth, fifth, and sixth characters of the string `A'. Thus, `B' will be defined as `tuvcdefwxyz'.

In general, if tex2html_wrap_inline34318 is detected as input, then `name' is assumed to be the name of a string and a and b to be integers (or equations which will be rounded to integers) marking the desired substring of this named string. The tex2html_wrap_inline34320 to the tex2html_wrap_inline34322 characters inclusive of this named string then replace the piece of input in square brackets. The square brackets are also removed.

The rules governing substrings are as follows. Suppose that we encounter the sequence of characters tex2html_wrap_inline34338 in a command line. N should be the name of a string and a and b are equations which will be rounded to the nearest integer. Suppose that L is the length of the string whose name is N.



David Wooff
Wed Oct 21 15:14:31 BST 1998