JavaScript · String Methods · Interactive
String Methods,
in the real world
All 32 String methods illustrated with real scenarios — form validators, URL slugs, receipt formatters, search engines.
// Real string problems, real methods const input = " Mankal@Fork.DEV "; input.trim(); // "Mankal@Fork.DEV" input.toLowerCase(); // "mankal@fork.dev" input.includes("@"); // true // Build a URL slug "Hello World!" .toLowerCase() .replace(/[^a-z0-9]+/g, "-") .replace(/-$/, ""); // "hello-world"
What you'll learn
5 real-world scenarios
Form validation
Clean and validate user input
trimincludesstartsWithendsWithChat messages
Format and search text
toUpperCasereplacesplitrepeatURL slug builder
Titles to URL slugs
toLowerCasereplacereplaceAllReceipt formatter
Pad and align output
padStartpadEndslicerepeatSearch & highlight
Find text in content
indexOflastIndexOfmatchsubstringQuick reference
All methods at a glance
Search
Transform
Extract
Build