PCase Function:

The PCase function returns a string in proper case. If the input string is Null, PCase returns Null. It's operation is similar to the built in LCase and UCase VBScript functions. The PCase function capitalizes the first letter of each word in the string and the remaining letters to lower case. vbTab's are stripped from the string before processing. PCase may have unexpected results in strings containing HTML mixed with text.

Syntax:
string = PCase(string)
Example Usage:
Make a string proper case.
<%
Dim a
a =	"My dog has fleas and i wish they would go away." & _
	vbCrLf & vbCrLf & "What can I do?" & vbCrLf & "help me out."
a =	PCase(a)
%>
In this example, a is equal to:
My Dog Has Fleas And I Wish They Would Go Away.

What Can I Do?
Help Me Out.
ASP Source Code:
<%
Private Function PCase(byVal string)
	Dim Tmp, Word, Tmp1, Tmp2, firstCt, a, sentence, c, i
	If IsNull(string) Then
		PCase = Null
		Exit Function
	Else
		string = CStr( string )
	End If
	a = Split( string, vbCrLf )
	c = UBound(a)
	i = 0
	For each sentence in a
		Tmp = Trim( sentence )
		Tmp = split( sentence, " " )
		For Each Word In Tmp
			Word = Trim( Word )
			Tmp1 = UCase( Left( Word, 1 ) )
			Tmp2 = LCase( Mid(  Word, 2 ) )
			PCase = PCase & Tmp1 & tmp2 & " "
		Next
		PCase = Left( PCase, Len(PCase) - 1 )
		If i = c then
		Else
			PCase = PCase & vbCrLf
		End If
		i = i + 1
	Next
End Function
%>