I understand you are working in a very Old Programming language which is not been used for years and the problem is now you have to make First letter capital for all the words in a sentence.
If you are a PHP Programmer you would have known this function called ucwords()
But, In classic ASP there is no default function like ucwords().
No worries here is the program you can just copy paste and use this in your code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
<% function ucwords(strInput) Dim iPosition,iSpace,strOutput iPosition = 1 do while InStr(iPosition, strInput, " ", 1) <> 0 iSpace = InStr(iPosition, strInput, " ", 1) strOutput = strOutput & UCase(Mid(strInput, iPosition, 1)) strOutput = strOutput & LCase(Mid(strInput, iPosition + 1, iSpace - iPosition)) iPosition = iSpace + 1 loop strOutput = strOutput & UCase(Mid(strInput, iPosition, 1)) strOutput = strOutput & LCase(Mid(strInput, iPosition + 1)) ucwords = strOutput end function 'usage example response.write(ucwords("spider man")&"<br>") dim afterCase afterCase = ucwords("this is just a test") response.write(afterCase) %> |
The above function and the usage show how to Uppercase the first character of each word in a string in Classic ASP.
The output will be:
This Is Just A Test