Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 873 Bytes

File metadata and controls

17 lines (13 loc) · 873 Bytes

String Methods

JavaScript provides a wide array of string methods for manipulating and working with strings.

Useful Methods 📦

  • charAt(): Returns the character at a specified index.
  • concat(): Joins two or more strings.
  • includes(): Checks if a string contains a specified substring.
  • indexOf(): Returns the index of the first occurrence of a specified substring.
  • replace(): Replaces a specified value with another value in a string.
  • slice(): Extracts a part of a string and returns it as a new string.
  • split(): Splits a string into an array of substrings.
  • substring(): Extracts characters from a string between two specified indices.
  • trim(): Removes whitespace from both ends of a string.

Further Reference: Useful string methods