VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This code turns any variable into Sentence Case

by Mark (a.k.a. Aldinator) (1 Submission)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 4th November 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This code turns any variable into Sentence Case

Rate This code turns any variable into Sentence Case



Dim temp as string
dim q as integer
temp = text1.text
For q = st To st + sl
    If Mid(temp, q, 1) = " " Then
        Mid(temp, q + 1, 1) = UCase(Mid(temp, q + 1, 1))
    ElseIf q = 1 Then
        Mid(temp, 1, 1) = UCase(Mid(temp, 1, 1))
    End If
    Next q
    text1.text = temp
end sub

Download this snippet    Add to My Saved Code

This code turns any variable into Sentence Case Comments

No comments have been posted about This code turns any variable into Sentence Case. Why not be the first to post a comment about This code turns any variable into Sentence Case.

Post your comment

Subject:
Message:
0/1000 characters