Chapter

String Methods

From ComputerScienceOne by Dr Chris Bourke

Concepts

  1. How do you access individual characters with the String charAt() method?

    "Characters in a string are 0-indexed just as with elements in arrays. The charAt() method accesses an individual character by providing an index. String fullName = \"Tom Waits\"; char firstInitial =

  2. How do you find the length of a string and iterate over its characters?

    "When accessing individual characters in a string, it is necessary to know the length of the string so that we do not access invalid characters. The length() method returns an int that represents the

  3. How does string concatenation work in Java?

    "Java has a concatenation operator built into the language. The familiar plus sign, +, can be used to combine one or more strings by appending them to each other. Concatenation results in a new string

String Methods | ComputerScienceOne | Bifalgorithm | Bifalgorithm