Skip to main content
CS Teaching Tips

Main navigation

  • Browse All Tips
  • Tags
  • 3D
  • About
  • Rate Tips
  • Tip Sheets

Have students label a string’s index values to help them understand how to use Java’s substring method.

Share Have students label a string’s index values to help them understand how to use Java’s substring method. with FacebookShare Have students label a string’s index values to help them understand how to use Java’s substring method. with Twitter
  • It is easier for students to choose the correct starting and ending arguments for substring when they have visual reference for characters and indices of the string.
  • The following is an example table containing string character values and index values.
String Values h e l l o
Index Values 0 1 2 3 4

More about this tip

Tags

  • AP A
  • Java
External Source

Leigh Ann Sudol-DeLyser’s notes from 2009 AP CS A exam.

Other Tips By
Other Tips By Leigh Ann Sudol-DeLyser

Similar tips

Show code where the name of the method’s actual arguments and formal parameters are different so students see first hand that these two items don’t have to match for code to execute and improve their understanding of scope.
Teach students how to find built-in Java methods in the Javadocs documentation so they can are prepared to use this skill on the AP CS exam.
Have students practice looping through an array in as many ways as possible, such as forwards and backwards, to increase their comfort with array looping.
  • CSTT Facebook
  • CSTT Twitter

For more information or to report a bug, contact us at admin@csteachingtips.org. Built with Bootstrap. Footer Icons by Mohammed Alyousfi. Powered by Drupal.

Privacy Policy

  • National Science Foundation
  • Sage Fox Group
  • Harvey Mudd College