CHAPTER 15

image

String Manipulation

In many languages, string manipulation is achieved by using a library of string functions or, as in Java, the methods of a String class. COBOL also uses a library of string-manipulation functions, but most string manipulation is done using reference modification and the three string-handling verbs: STRING, UNSTRING, and INSPECT.

This chapter starts by examining the string-handling verbs. These verbs allow you to count and replace characters, and concatenate and split strings. You are then introduced to reference modification, which lets you treat any string as an array of characters. Finally, you learn about the ...

Get Beginning COBOL for Programmers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.