ASP Code

Mimic PHP's uc_first() function with ASP

With uc_first(), PHP programmers can ensure proper formatting of names and other strings. This function capitalizes (converts to uppercase) the first character/letter, and converts the remaining characters to lowercase. Here's a function that does this in ASP:

Function ucFirst( strWord )
	strWord = trim( strWord & "" )
	if len( strWord ) > 0 then
		ucFirst = uCase( left( strWord, 1 ) ) & _
				  lcase( right( strWord, len( strWord ) - 1 ) )
	end if
End Function

Leave a Reply

Your email address will not be published. Required fields are marked *

To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image