Skip to content

Instantly share code, notes, and snippets.

@Patrique
Created July 29, 2013 01:13
Show Gist options
  • Save Patrique/6101577 to your computer and use it in GitHub Desktop.
Save Patrique/6101577 to your computer and use it in GitHub Desktop.
<%
Function MixedCase(strInput)
Dim strPos, strSpace, strOutput
' Set our position variable to the start of the string.
strPosition = 1
' Loop to check spaces
Do While InStr(strPosition, strInput, " ", 1) <> 0
strSpace = InStr(strPosition, strInput, " ", 1)
strOutput = strOutput & UCase(Mid(strInput, strPosition, 1))
strOutput = strOutput & LCase(Mid(strInput, strPosition + 1, strSpace - strPosition))
strPosition = strSpace + 1
Loop
' Last word is currently uncapitalized - fix this
strOutput = strOutput & UCase(Mid(strInput, strPosition, 1))
strOutput = strOutput & LCase(Mid(strInput, strPosition + 1))
MixedCase = strOutput
End Function
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment