-
Initial Caps
VB gurus,
How do I set Initial Capitol letters on a string? I know
the command in SQL is "initcap(string)", but that doesn't
work in VB 6.0. Any clues?
Andrew
*** Thanks JHausmann ***
*** Your solution worked. ***
[Edited by aatwell on 09-07-2000 at 04:46 PM]
-
Give this a run:
Dim sSource as string
Dim sResult as string
sResult = Ucase(Left(sSource,1)) & mid(sSource,2,len(sSource))
-
This might be easier if you have multiple words in a string that must be converted to proper case all at once:
Code:
Dim strMyString As String
strMyString = "hello world"
strMyString = StrConv(strMyString, vbProperCase)
MsgBox strMyString 'gives us "Hello World"