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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

proper case string conversion 2

Status
Not open for further replies.

onetomany

Programmer
May 15, 2000
55
0
0
US
Is there a VB function that will convert a string to proper case i.e. "holly grow" is converted to "Holly Grow". similar to the ucase and lcase functions.
I am almost positive that I have used this before but I cannot remember the function name.


thanks
 
Hi,

Dim str As String, str1() As String, strR As String
str = "does this help"
str1() = Split(str, " ")
For intA = 0 To UBound(str1)
strR = Left(str1(intA), 1)
str1(intA) = Replace(str1(intA), strR, UCase(strR), 1, 1)
Next
str = Join(str1(), " ")
Debug.Print str

Jon
 
Try:

StrConv("this is a test", vbProperCase) Troy Williams B.Eng.
fenris@hotmail.com

 
thanks to the both of you.
that is exactly what i was thinking of fenris.
 
Like Jon, I too wrote a routine for this. Well, I learned my somthing today. Guess I should call it a day. X-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top