Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Knowledge Base

Post new topic   Reply to topic
Capatalize first Letter in all words in string
View previous topic :: View next topic  
Author Message
Avis
Junior Poster


Joined: 07 Oct 2003
Posts: 510
Location: India

PostPosted: Oct 8th, 2003 05:36 AM    Post subject: Capatalize first Letter in all words in string Reply with quote

Code:
Function UpAllWords(ByVal TEXTIN As String) As String

Dim TextinS() As String
Dim Letter As String
Dim FinalWord As String
Dim MyItem As Integer
Dim c As Integer

TextinS = Split(TEXTIN, " ")
MyItem = UBound(TextinS)
For c = 0 To MyItem
     Letter = Left(TextinS(c), 1)
     Letter = UCase(Letter)
     FinalWord = (Right(Letter, 1)) & Mid(TextinS(c), 2)
     TextinS(c) = FinalWord
     If UBound(TextinS) = c Then
          UpAllWords = UpAllWords & TextinS(c)
     Else
          UpAllWords = UpAllWords & TextinS(c) & " "
     End If
Next c
End Function
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Knowledge Base All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic