Js Strings Methods — Free Javascript Tutorial
Learn Js Strings Methods in Javascript with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
TL;DR: Learn Js Strings Methods in Javascript with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
Written & reviewed by the Syllab.in Academic Team (CBSE/NCERT subject experts) · Updated
Js Strings Methods in Javascript
Strings in JS are immutable sequences of characters. Use single quotes, double quotes, or backticks (template literals).
Key methods: `.length`, `.toUpperCase()`, `.toLowerCase()`, `.trim()` (remove spaces), `.split()`, `.join()`, `.includes()`, `.startsWith()`, `.endsWith()`.
Slicing: `.slice(start, end)` — end not included. `.substring(start, end)` — similar. `.charAt(index)` or `str[index]`.
Replace: `.replace(old, new)` — first occurrence only. `.replaceAll(old, new)` — all. `.repeat(n)` — repeat string n times.
Learn Js Strings Methods step by step with Syllab's free interactive Javascript tutorial — runnable code examples, practice exercises and instant AI feedback, all free with no signup. Explore the full Javascript course →