함수 uppercase()

1 개요[ | ]

uc
upcase
upper
uppercase
uppercaseString
strtoupper
toupper
toUpperCase

2 Bash[ | ]

echo "Hello, World" | tr 'a-z' 'A-Z'

3 C[ | ]

#include <ctype.h>
#include <stdio.h>
int main(void) {
    char string[] = "Wiki means fast?";
    int i;
    for (i = 0; i < sizeof(string); ++i) {
        string[i] = toupper(string[i]);
    }
    puts(string); // WIKI MEANS FAST?
    return 0;
}

4 C++[ | ]

#include <iostream>
using namespace std;
string strtoupper(string str) {
    for(auto &c: str) c = toupper(c);
    return str;
}
int main() {
    string str = "Hello World!";
    string str2 = strtoupper(str);
    cout << str << endl; // Hello World!
    cout << str2 << endl; // HELLO WORLD!
}
#include <iostream>
#include <algorithm> // transform
using namespace std;
string strtoupper(const string str) {
    string ret = str;
    transform(ret.begin(), ret.end(),ret.begin(), ::toupper);
    return ret;
}
int main() {
    string str = "Hello World!";
    string str2 = strtoupper(str);
    cout << str << endl; // Hello World!
    cout << str2 << endl; // HELLO WORLD!
}

5 C#[ | ]

"Wiki means fast?".ToUpper();        // "WIKI MEANS FAST?"

6 Excel[ | ]

=UPPER("Hello")
// HELLO

7 Go[ | ]

package main
import (
	"fmt"
	"strings"
)
func main() {
	fmt.Print( strings.ToUpper("hello world") )
}

8 Java[ | ]

String str = "Hello World!";
System.out.println(str.toUpperCase());

9 JavaScript[ | ]

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

10 Objective-C[ | ]

NSString *str = @"Hello World!";
NSLog(@"%@", [str uppercaseString];

11 Perl[ | ]

$str = "Hello World!";
print uc($str);

12 PHP[ | ]

$str = "Hello World!";
echo strtoupper($str);

13 Python[ | ]

str = "Hello World!"
print( str.upper() )

14 Ruby[ | ]

str = "Hello World!"
str2 = str.upcase
puts str2
str = "Hello World!"
str.upcase!
puts str

15 Scheme[ | ]

(use-modules (srfi srfi-13))
(string-upcase "Wiki means fast?") ;  "WIKI MEANS FAST?"

16 Windows Batch[ | ]

@echo off
setlocal
set str2=
set "str=Hello World!"
for /f "skip=2 delims=" %%I in ('tree "\%str%"') do if not defined str2 set "str2=%%~I"
set "str2=%str2:~3%"
echo %str2%

17 SQL[ | ]

17.1 MySQL[ | ]

SELECT UPPER( "Hello World" );
-- HELLO WORLD

17.2 Oracle[ | ]

SELECT UPPER('Hello World') FROM DUAL;
-- HELLO WORLD

18 같이 보기[ | ]

19 References[ | ]