Please enable JavaScript to use CodeHS

AP Computer Science A (Mocha)

Lesson 3.5 Strings Methods

Description

In this lesson, students will learn about String methods. They’ll explore a code example that demonstrates String indexing and looping. Students will then complete coding exercises where they write methods that transform Strings in various ways, including converting text to uppercase, adding specific prefixes, and formatting names. Through these exercises, students will simulate real-world text manipulation scenarios!


Objective

Students will be able to:

  • Read documentation for how to use the methods of the String class
    • Either in the DOCS tab in the CodeHS editor, or elsewhere online
  • Call methods on String objects to get information about the string, such as length or characters at given indices
  • Utilize String methods to create programs that manipulate strings in different ways