Skip to main content
D
JavaScript
JavaScript String Methods

JavaScript String Methods

JavaScript string methods alter text automatically.

Read Time
5 min read
Difficulty
Beginner
Last Updated
Jun 15, 2026
Version
v1.0.0

Introduction

JavaScript provides built-in tools called methods to manipulate strings. Developers use these methods to change text to uppercase, replace specific words, or extract a small section of a larger paragraph.

Example

Example
1/* this uses string methods */
2let text = "Apple, Banana";
3let part = text.slice(7, 13); // part is "Banana"
4let loud = text.toUpperCase();

Key Points

  • The `toUpperCase()` method capitalizes every letter.
  • The `slice()` method extracts a section of text.
  • The `replace()` method swaps one word for another.
  • The `trim()` method removes extra spaces at the ends.

Up Next

Continue your journey with the next topic.

Go to JS Arrays