How to determine that the line starts with a certain letter?

0 like 0 dislike
5 views
In General, you need to make it so that if the user begins typing in the input symbols and they will begin with a "+7", it will run a certain action if something else, then a different action.
by | 5 views

1 Answer

0 like 0 dislike
if ('^\\+7'.test('test string')) { // action if beginning with +7 } else { // otherwise }
by

Related questions

110,608 questions
257,186 answers
0 comments
33,950 users