w3schools.com

JavaScript String Methods (opens in new tab)

Discussed on DEV

A String in JavaScript is a sequence of characters used to store text. let course = "JavaScript"; 1. String length Purpose Returns the total number of characters in a string. Syntax string.length Example let company = "OpenAI"; console.log(company.length); Output 6 Real-Time Example Checking password length before registration. 2. String charAt() Purpose Returns the character at a specified index. Syntax string.charAt(index) Example let city = "Madurai"; console.log(city.charAt(3)); Output u ...

Read the original article
Sign in to keep reading the full article.

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help