RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
(^[A-Za-z])|(\s)([A-Za-z])
Description
This expression will return the first letter of each word in a string. Best used if you need to get initials from a name. "James Kramer" = "J K" & "Sir Richard Branson" = "S R B" & "33 yoYo 654 ma" = "y m"
Matches
James Kramer | Sir Richard Branson | 33 yoYo 654 ma
Non-Matches
33 66 4ju
Author Rating: The rating for this expression. J D
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: First Letter of Each Word (Initials)
Name: JD
Date: 3/25/2004 7:41:55 AM
Comment:
I needed to display a persons initials with the company they are at for the day in an Outlook Calendar View. Since I am storing the Full Name in one column I needed to get the first letter of the first and last name.


Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials