touppercase() javascript code example

Example 1: uppercase javascript

var str = "Hello World!";
var res = str.toUpperCase();  //HELLO WORLD!

Example 2: touppercase javascript array

const names = ['Ali', 'Atta', 'Alex', 'John'];

const uppercased = names.map(name => name.toUpperCase());

console.log(uppercased);

// ['ALI', 'ATTA', 'ALEX', 'JOHN']

Example 3: uppercase javascript

var str = "Hello World!";
var res = str.toUpperCase();

Example 4: toupper

#include <stdio.h>
#include <ctype.h>
int main() {
    char c;

    c = 'm';
    printf("%c -> %c", c, toupper(c));

    c = 'D';
    printf("\n%c -> %c", c, toupper(c));

    c = '9';
    printf("\n%c -> %c", c, toupper(c));
    return 0;
}

Tags:

Java Example