Uppercase, Capitalize the first letter of every word in ASP
October 22nd, 2007 | Posted in Programming |
Turn the first letter of every word in a string to Upper case in ASP by using thes function. The original script is from http://www.scripts.com.
<%finalText = format_ucase("Every word in this string will be capitalized")
function format_ucase(tname)
do while instr(tname, " ")
temp_string = left(tname, instr(tname," " ) -1)
' ucase the first letter
format_ucase = format_ucase & ucase(mid(temp_string, 1,1))
' lcase for the rest of the word
format_ucase = format_ucase & lcase(mid(temp_string,2)) & " "
tname = right(tname, len(tname) - instr(tname," " ))
loop
'send out the rest of the word
format_ucase = format_ucase & ucase(mid(tname, 1,1))
format_ucase = format_ucase & mid(tname,2)
end function
%>







One Response to “Uppercase, Capitalize the first letter of every word in ASP”
By wellknownQ8 on May 26, 2008 | Reply
It’s strange that there is no special function or simple one to do this in asp(VB)!
but this helped me anyhow, thank you very much