/ Published in: ASP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Function PCase(ByVal strInput)' As String Dim I 'As Integer Dim CurrentChar, PrevChar 'As Char Dim strOutput 'As String PrevChar = "" strOutput = "" For I = 1 To Len(strInput) CurrentChar = Mid(strInput, I, 1) Select Case PrevChar Case "", " ", ".", "-", ",", """", "'" strOutput = strOutput & UCase(CurrentChar) Case Else strOutput = strOutput & LCase(CurrentChar) End Select PrevChar = CurrentChar Next 'I PCase = strOutput End Function
URL: http://www.asp101.com/samples/pcase.asp