The toLower() function returns a string, converting any uppercase letters in the original string to lowercase. The syntax is as follows:

toLower(<string>);

For example, this script converts strings so that all of the letters following the first character in each word are lowercase.

For each word in a person’s name, the initial character is assigned to the initial variable and the remaining characters (if there are any) are assigned to the rest variable. The toLower() function converts the string stored in the rest variable to lowercase letters. Then, the characters stored in the initial and the rest variables are assigned to the fullname variable.

Once each name has been read and converted, ASL prints it before the next name is read and converted.

ASL Script (toLower_do.asl):
START {
do {fullname="";}
 rep(READNAME) eol
}
do {
 print(fullname);
}
READNAME {
 initial:char.rest:word?
}
do {
 rest = toLower(rest);
 name=initial.rest;
 fullname = fullname.name." ";
}
DEFAULT {
 ..eol
}
do {
 print("Failed match");
}
Input (toLower_do.txt):
JOHN DOE
JANE Q PUBLIC
Output:
$ sm_adapter --file=toLower_do.txt toLower_do.asl
John Doe
Jane Q Public
$