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

toUpper(<string>);

The following script assigns the first letter of each word to the variable a. The a variable is concatenated with another variable, name, to form an acronym. The toUpper() function capitalizes the entire acronym before it is printed.

ASL Script (toUpper_do.asl):
name="";
START {
 rep(FIRSTLETTER) eol
}
do {
 print(toUpper(name));
}
FIRSTLETTER {
 a:char.word?
}
do {
 name=name.a;
}
DEFAULT {
 ..eol
}
do {
 print("Failed match");
}
Input (to Upper_do.txt):
I see several tall buildings
New York City
Output:
$ sm_adapter --file=toUpper_do.txt toUpper_do.asl
ISSTB
NYC
$