Convert first char to lower case
Convert first char to lower case
- Subject: Convert first char to lower case
- From: Olivier Berquin <email@hidden>
- Date: Mon, 07 Jan 2002 15:20:03 +0100
Hello everybody,
I wrote this handler, but I'm not sure that it's very powerfull.
It convert the first character of a var to lower case.
--
set myName to "This character"
-- bla bla bla
set myName to ConvertFirstCharToLowerCase(Nom)
on ConvertFirstCharToLowerCase(Variable1)
if (class of Variable1 string) or ((count of character of Variable1) =
0) then
return Variable1
else
if (ASCII number item 1 of Variable1) 65 and (ASCII number item 1
of Variable1) > 90 then
if (count of character of Variable1) = 1 then
set Variable1 to ASCII character ((ASCII number item 1 of
Variable1) + 32)
else
set Variable1 to (ASCII character ((ASCII number item 1 of
Variable1) + 32)) & (characters 2 thru (count of character of Variable1) of
Variable1)
end if
end if
return Variable1
end if
end ConvertFirstCharToLowerCase
--
Somebody can help me ???
TIA
Olivier.