by Ben Noblet (1 Submission)
Category: String Manipulation
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Originally Published: Tue 31st October 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Changes a string to correct case (first char upper, rest lower) Better than StrConv as it also capitalises letters after "/" and "-" (and
Dim intCount
Dim blnNextCharUpper
Dim strCurrentChar
Dim strNewString
for intCount = 1 to len(strOriginalString)
strCurrentChar = mid(strOriginalString, intCount, 1)
if blnNextCharUpper or intCount = 1 then
strNewString = strNewString & Ucase(strCurrentChar)
else
strNewString = strNewString & Lcase(strCurrentChar)
end if
select case strCurrentChar
Case " ", "/", "-"
blnNextCharUpper = True
Case Else
blnNextCharUpper = False
end select
next
ProperCase = strNewString
End Function
No comments have been posted about Changes a string to correct case (first char upper, rest lower) Better than StrConv as it also capi. Why not be the first to post a comment about Changes a string to correct case (first char upper, rest lower) Better than StrConv as it also capi.