Please enable JavaScript to use CodeHS

AP Computer Science A (Mocha)

Lesson 3.8 String Processing

Description

So far, students have explored how to write their own methods that accept parameters and return values, and have learned how Strings and characters interact. They’ve also learned to use methods from the String and Character classes and how to loop through a String’s characters using a for loop. In this lesson, students will combine these skills and write methods for more advanced String manipulations.


Objective

Students will be able to:

  • Create methods that perform advanced manipulations on Strings and characters
  • Develop pseudocode algorithms for solutions before writing the actual Java code
  • Debug their code
  • Practice the common algorithm for String manipulation, including:
    • Looping through each character of the String
    • Performing specific actions based on each character
    • Building a result String by appending processed characters to an initially empty String
    • Returning the final result String