Proper Capitalization

Proper Capitalization

This code is used to capitalize the first letter of every word in a string passed as an argument.  All you have to do is past the function code near the beginning of your script command and call the function using the command PropCase(String).  Simple as that.

Function PropCase(strTemp)
 Dim intFound
 Dim strTempName

   strTempName = strTempName & UCase(Left(strTemp, 1))
   strTemp     = Right(strTemp, Len(strTemp) - 1)
   intFound    = InStr(strtemp, " ")
   If intFound <> 0 Then
     strTempName = strTempName & Left(strTemp, intFound)
     strTemp = Right(strTemp, Len(strTemp) - intFound)
     strTempName = strTempName & strTemp
     Exit Do
   End If
 Loop While intFound <> 0
 Response.Write strTempName
End Function

You might also like...


Scott Dennison


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Brevity is the soul of wit” - Shakespeare