upperCase to lowerCase
Jan Decroos
jan.decroos at groepvanroey.be
Mon Jan 14 12:13:00 EST 2002
maybe this can help...
In stead of changing char by char, you can replace every 'a' by 'A', 'b' by
'B', ... Replace is VERY fast.
(if you want to force uppercase("é") to be "E", not to be (french é, first
char in élève for instance, you
on mouseUp
answer upperCase("this is text")
answer lowerCase("THIS TOO")
end mouseUp
constant cLowerChars = "abcdefghijklmnopqrstuvwxyz"
constant cUpperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
function upperCase pString
set the casesensitive to true
put 0 into xx
repeat for each char lChar in cLowerChars
add 1 to xx
replace lChar with char xx of cUpperChars in pString
end repeat
return pString
end upperCase
function LowerCase pString
set the casesensitive to true
put 0 into xx
repeat for each char lChar in cUpperChars
add 1 to xx
replace lChar with char xx of cLowerChars in pString
end repeat
return pString
end LowerCase
jan
More information about the use-livecode
mailing list