Module 4: Strings

CMPS 162: Introduction to Programming


Strings, i.e., text in the memory of a computer, are one of the most important types of values in programming. Many things can be represented by strings. Languages have built-in functionality to operate on strings, such as getting the length of a string or extracting a substring. For example, one could search a string to see if it follows the proper formatting for an address, meaning that there should be a street number followed by a space, then the street name, and finally the city and ZIP code. Almost all programs operate on strings, at the least to simply communicate results to the user.

Module Objectives

  • Illustrate changing case
  • Show measuring length and extracting parts of strings
  • Describe finding segments in strings
  • Describe finding a character at a location in a string
  • Apply replacing characters in strings

Learning Resources

  • Module 3 Readings: Chapters 21 thru 25 from Myers

Learning Activities

  • Module 3 Assignment: Interactive Coding Exercises 21 thru 25

For Further Study

  • Read more about strings on Wikipedia

Leave A Reply

Your email address will not be published. Required fields are marked *