Proper case in Visual basic 6.0

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Sep 2006
Posts: 4
Reputation: seibor is an unknown quantity at this point 
Solved Threads: 0
seibor seibor is offline Offline
Newbie Poster

Proper case in Visual basic 6.0

 
0
  #1
Oct 12th, 2006
hi all, can anyone suggest me how to display propercase in vb
eg. HELLo WOrld is Hello World
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 188
Reputation: aparnesh is an unknown quantity at this point 
Solved Threads: 10
aparnesh's Avatar
aparnesh aparnesh is offline Offline
Junior Poster

Re: Proper case in Visual basic 6.0

 
0
  #2
Oct 12th, 2006
Here's the Code to display a WORD in Proper Case. You can enhance it easily to use it for a string.

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Public Function InitCapWord(ByVal mString As String) As String
  2. Dim mRet As String
  3. If Len(Trim(mString)) > 1 Then
  4. Dim mFirst As String
  5. Dim mRest As String
  6. mFirst = UCase(Mid(mString, 1, 1))
  7. mRest = LCase(Right(mString, Len(mString) - 1))
  8. mRet = mFirst & mRest
  9. Else
  10. mRet = mString
  11. End If
  12. InitCapWord = mRet
  13. End Function
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Proper case in Visual basic 6.0

 
0
  #3
Oct 12th, 2006
Rock On!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 3533 | Replies: 2
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC