jrthor2
08-02-2004, 11:09 AM
I found a script that takes a string and converts it to proper case (upper/lower case). I am trying to add to it to lower case words like "a", "and", etc. I got it working, but it is only lower caseing "a" in my string, not the words "and", "to", etc. below is the code snippet I am trying to add.
strOutput = strOutput & UCase(Mid(strInput, iPosition, 1))
strOutput = strOutput & LCase(Mid(strInput, iPosition + 1))
'my code below
words = Array(" a ", " and ", " the ", " for ", " to " , " an " , " on ")
If (fix_case = "y") Then
'for w = LBound(words) To UBound(words)
for each w in words
response.write(w) 'this does print out my entire array of words
strOutput = Replace(strOutput, UCase(Lcase(w)), LCase(w))
Next
End If
strOutput = strOutput & UCase(Mid(strInput, iPosition, 1))
strOutput = strOutput & LCase(Mid(strInput, iPosition + 1))
'my code below
words = Array(" a ", " and ", " the ", " for ", " to " , " an " , " on ")
If (fix_case = "y") Then
'for w = LBound(words) To UBound(words)
for each w in words
response.write(w) 'this does print out my entire array of words
strOutput = Replace(strOutput, UCase(Lcase(w)), LCase(w))
Next
End If