JavaScript String Methods
Complete guide to JavaScript string methods and text manipulation
Table of Contents
Case Manipulation
Transform string case for formatting and comparison
Changing Case
Convert strings to uppercase, lowercase, or capitalize for consistent formatting
Searching & Testing
Find and test for substrings and patterns within strings
Finding Substrings
Search for text within strings using indexOf, includes, and search methods
Accessing Characters
Access individual characters and their codes using charAt, charCodeAt, and bracket notation
Start & End Checking
Check if strings start or end with specific substrings
Extracting Substrings
Extract portions of strings using various methods
Substring Methods
Extract portions of strings using slice, substring, and substr methods
Modern Character Access
Access characters using the modern at() method with negative indexing
String Modification
Modify strings through replacement, trimming, and splitting
Replacing Text
Replace text patterns using replace and replaceAll with strings or regex
Trimming & Padding
Remove whitespace with trim methods or add padding to reach desired length
Splitting & Joining
Convert between strings and arrays using split and join methods
String Formatting
Format strings with repetition, padding, and localization
Repeat & Concatenation
Repeat strings multiple times or combine them using various methods
Normalization & Locale
Handle Unicode normalization and locale-specific string operations
Template Literals & String.raw
Use template literals for string interpolation and String.raw for raw strings
Regular Expressions
Use regex patterns for advanced string operations
Regex String Methods
Use regular expressions with match, matchAll, and search for pattern matching