Share this page

# strupr

String Manipulation Functions

Converts a string to upper case.

    char *strupr( char *string);

string | The string whose characters are converted to upper case.

## Return Values

Returns the string in upper case.

## Example

In this example, the group name of a Vuser is converted to upper case. However, lr_whoami returns the group name as a static buffer and such buffers cannot be manipulated with. If manipulation is required, a copy of the static buffer must be created.

strdup creates a copy of the static buffer, groupname_static. The characters in the new buffer, groupname, are then converted to upper case with strupr.

        #include <string.h>

        int id;
        char * groupname_static, * groupname;

        // Get the groupname from VuGen

        lr_whoami (&id, &groupname_static, NULL);
        lr_output_message ("groupname=%s", groupname_static);

        // Make a copy of groupname_static so we can change it

        groupname = (char *)strdup(groupname_static);
        groupname = (char *)strupr(groupname);
        lr_output_message ("Upper case groupname=%s", groupname);
        free(groupname);

    Example: Output:
    Action.c(8): groupname=None
    Action.c(14): Upper case groupname=NONE

Tips to improve your search results... VuGen Function Reference Version 26.1 Function Reference 26.1 All View Local Help Center View Online Help Center Version: