Handling strings

About this task

COBOL provides language constructs for performing many different operations on string data items.

For example, you can:

  • Join or split data items.
  • Manipulate null-terminated strings, such as count or move characters.
  • Refer to substrings by their ordinal position and, if needed, length.
  • Tally and replace data items, such as count the number of times a specific character occurs in a data item.
  • Convert data items, such as change to uppercase or lowercase.
  • Evaluate data items, such as determine the length of a data item.