You are not logged in.

#1 2014-05-16 05:15:54

Muhammad
User RankUser RankUser RankUser RankUser RankUser Rank
بِسمِ اللَّهِ الرَّحمٰنِ الرَّحيمِ
From: Sahiwal Division
Registered: 2012-03-22
Posts: 22,197
Website

How to find first alphabetical letter in a string using JavaScript.

Find First Alphabetical Letter In a String Using JavaScript:


Maybe one of the shortest solutions:

'45 Church St'.match(/[a-zA-Z]/).pop();

Since match will return null if there are no alphanumerical characters in a string, you may transform it to the following fool proof solution:

('45 Church St'.match(/[a-zA-Z]/) || []).pop();


Online Web Tutorials And Interview Questions With Answers Forum:
https://globalguideline.com/forum/

2014-05-16 05:15:54

Advertisement
Ads By Google

Re: How to find first alphabetical letter in a string using JavaScript.



\n
The following user say "Thank You" for this post:Guest

Board footer