Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return First Letter of Every Word in a String 1

Status
Not open for further replies.

JordanR

Technical User
Oct 3, 2002
182
US
I know this is probably simple, but I haven't figured it out.
I want to take a string from a form input and return the first letter of each word. The input would be a business name so it wouldn't be a very long string.

exp. input = Tek Tips, Inc.
return = TTI

Thanks for the help.
 
How about this?
Code:
function Initials(Phrase)
dim wordarray
dim i
dim temp

temp = ""
WordArray = Split(Phrase," ")

for i = 0 to ubound(wordarray)
   temp = temp & ucase(left(wordarray(i)))
next
Initials = temp
end function

Not tested.



Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top