A string is a sequence of one or more characters that may consist of letters, numbers, or symbols. Strings in JavaScript are primitive data types and immutable, which means they are unchanging.

String Methods & Properties in JavaScript

In JavaScript, strings are primitive data types, and they come with several methods and properties that allow you to manipulate, query, and transform them. Here's a comprehensive overview:


String Properties

  1. length:

String Methods

  1. charAt(index):

  2. charCodeAt(index):

  3. concat(str2, str3, ...):

  4. includes(searchString):

  5. indexOf(searchString):

  6. replace(searchValue, newValue):

  7. slice(start, end):

  8. split(separator):

  9. toLowerCase():

  10. toUpperCase():

  11. trim():

  12. startsWith(searchString):