I read a really helpful post here How do I make the first letter of a string uppercase in JavaScript? and I was curious of a good solution using VBScript.
>> s = "first word of string"
>> WScript.Echo UCase(Left(s, 1)) & Mid(s, 2)
>>
First word of string
str = "mY nAME iS sACHIN"
arrStr = split(str," ")
For i=0 to ubound(arrStr)
word = lcase(trim(arrStr(i)))
word = replace(word,mid(word,1,1),chr(asc(mid(word,1,1))-32),1,1)
str1 = str1 & word & " "
next
msgbox trim(str1)
Output: My Name Is Sachin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With