Languages
[Edit]
EN

JavaScript - get nth string character

3 points
Created by:
Lilly-Grace-Greig
571

In this article, we would like to show you how to get n-th string character in JavaScript.

Quick solution:

 

Practical examples

Edit

1. Using String charAt() method

Edit

In this example, we use built-in String charAt() method to get n-th string character.

2. Using square brackets ([]) notation

Edit

String characters can be accessed with [] like in array case.

Alternative titles

  1. JavaScript - get n-th string character
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join