Aspects


vs


Home Page
About Us

Charat

The charAt() method is used to provide a single character by its index within a string.

Indexof

Indexof is a method in programming languages like Java, C#, JavaScript, etc



Others

Example

Also fwiw the indexof approach mentioned below also works but the indexof approach mentioned much slower the charat in this particular chase

from question  

Do something if Array element starts with a certain letter

I ve found that using a simple for-loop iterating over all elements in the string and comparing using charat performs faster than indexof or regex

from question  

Fastest way to check a string contain another substring in JavaScript?

Back to Home
Data comes from Stack Exchange with CC-BY-SA-4.0