Fiveable
Fiveable

substring(int beginIndex, int endIndex)

Definition

The substring() method is used to extract a portion of a string based on the specified beginning and ending indexes. It returns a new string that contains the characters from the original string within the given range.

Related terms

length(): This method returns the length of a string.

indexOf(String str): This method returns the index within this string of the first occurrence of the specified substring.

replace(char oldChar, char newChar): This method replaces all occurrences of a specified character in a string with another character.

"substring(int beginIndex, int endIndex)" appears in:

Additional resources (1)

  • AP Computer Science A - Unit 2 Overview: Using Objects

collegeable - rocket pep

Are you a college student?

  • Study guides for the entire semester

  • 200k practice questions

  • Glossary of 50k key terms - memorize important vocab


Fiveable
About Us

About Fiveable

Blog

Careers

Code of Conduct

Terms of Use

Privacy Policy

CCPA Privacy Policy

Resources

Cram Mode

AP Score Calculators

Study Guides

Practice Quizzes

Glossary

Cram Events

Merch Shop

Crisis Text Line

Help Center

Stay Connected


© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.

About Us

About Fiveable

Blog

Careers

Code of Conduct

Terms of Use

Privacy Policy

CCPA Privacy Policy

Resources

Cram Mode

AP Score Calculators

Study Guides

Practice Quizzes

Glossary

Cram Events

Merch Shop

Crisis Text Line

Help Center

© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.