With Javascript how would I search the first three letters in a string and see if they match "ABC"? Thanks
Using a regular expression:
str.match(/^ABC/);
or using the substring
method:
str.substring(0, 3) == 'ABC';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With