Thursday, October 4, 2007

VBScript: Capitalize String Function

Function fncCapitalize(ByVal str)
Dim intI, arrTmp
arrTmp = Split(str, " ")
str = ""
For intI = 0 To Ubound(arrTmp)
str = str & UCase(Left(arrTmp(intI), 1)) & Right(arrTmp(intI), Len(arrTmp(intI)) - 1) & " "
Next
fncCapitalize = Trim(str)
End Function

No comments: