Name

upper — convert a string to upper case

Synopsis

string upper(str);
string str;

Description

Returns str with all lower case characters converted to upper case.

Example 55. upper Example

// A function to perform a case insensitive comparison by converting both
// strings to upper case and then comparing
function strcmp(string s1, string s2)
{
    s1 = upper(s1);
    s2 = upper(s2);
    if(s1 == s2)
        return 0;
    else if(s1 < s2)
        return -1;
    else
        return 1;
}

See Also

This function complements the lower() function.