One of the main strengths of the M language is its ability to manipulate text. This chapter contains most of the language elements that perform those functions. As such, it is probably the most important and most unique set of language concepts in this text. The experienced programmer will probably benefit by reviewing the entire chapter and its exercises. It would be well to begin with the summary at the end, which provides a useful guide to the language elements covered in the body of the chapter.
In the previous two chapters we considered, first, arithmetic operators and functions and then logical and relational operators, including a few that acted on string relations. This chapter is concerned with the final group of (non-relational) operators and some functions used for string manipulation. With the coverage of the string operators, we will have introduced each of the major language elements: variables, constants, operators, functions, and commands. The remaining chapters expand on some of these elements, especially commands, but it is comforting to realize that there are no major new categories of language components to learn about.
Consider what operations might be performed on a string of text, in addition to using the contains, equals, or follows operators previously described. It might be desirable to determine the length of a string, to find or extract some substring from the text, to concatenate two strings together, to insert or modify
Copyright Butterworth-Heinemann 1997 under license agreement with Books24x7