|
-
Sep 7th, 2000, 12:08 PM
#1
Thread Starter
Lively Member
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]
-
Sep 7th, 2000, 01:12 PM
#2
Frenzied Member
Give this a run:
Dim sSource as string
Dim sResult as string
sResult = Ucase(Left(sSource,1)) & mid(sSource,2,len(sSource))
-
Sep 8th, 2000, 10:58 AM
#3
Guru
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"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|