How to convert a string to lower case?

Post » Sun Jul 31, 2011 1:14 pm

How do you convert a string variable to lower case? Say, you have a string with the value ''My String''. How do you convert it to ''my string''? There seems to be a ToLower Function, but I can't see how to use that properly? Any suggestions would be appreciated.
User avatar
Trey Johnson
 
Posts: 3295
Joined: Thu Oct 11, 2007 7:00 pm

Post » Sun Jul 31, 2011 12:58 pm

Try this:

scn testfunctionshort asciicodestring_var inputstring_var outputstring_var characterBegin Function {input}	let output := ""	while (index < sv_length input)		let character := input[index]		let asciicode := CharToASCII character		let asciicode := ToLower asciicode		let output := sv_Construct "%z%a" output asciicode		let index += 1	loop		SetFunctionValue $outputEnd

User avatar
Miss K
 
Posts: 3458
Joined: Sat Jan 20, 2007 2:33 pm

Post » Sun Jul 31, 2011 4:57 pm

Seems to be working now thanks.
User avatar
Hannah Whitlock
 
Posts: 3485
Joined: Sat Oct 07, 2006 12:21 am


Return to IV - Oblivion