(→Python) |
Jmnote bot (토론 | 기여) 잔글 (봇: 자동으로 텍스트 교체 (-source +syntaxhighlight)) |
||
12번째 줄: | 12번째 줄: | ||
==Bash== | ==Bash== | ||
[[category: Bash]] | [[category: Bash]] | ||
< | <syntaxhighlight lang='bash'> | ||
echo "Hello, World" | tr 'a-z' 'A-Z' | echo "Hello, World" | tr 'a-z' 'A-Z' | ||
# HELLO, WORLD | # HELLO, WORLD | ||
</ | </syntaxhighlight> | ||
==C== | ==C== | ||
[[category: C]] | [[category: C]] | ||
< | <syntaxhighlight lang="c"> | ||
#include <ctype.h> | #include <ctype.h> | ||
#include <stdio.h> | #include <stdio.h> | ||
32번째 줄: | 32번째 줄: | ||
return 0; | return 0; | ||
} | } | ||
</ | </syntaxhighlight> | ||
==C++== | ==C++== | ||
38번째 줄: | 38번째 줄: | ||
[[분류: C++]] | [[분류: C++]] | ||
< | <syntaxhighlight lang='cpp'> | ||
#include <iostream> | #include <iostream> | ||
using namespace std; | using namespace std; | ||
51번째 줄: | 51번째 줄: | ||
cout << str2 << endl; // HELLO WORLD | cout << str2 << endl; // HELLO WORLD | ||
} | } | ||
</ | </syntaxhighlight> | ||
< | <syntaxhighlight lang='cpp'> | ||
#include <iostream> | #include <iostream> | ||
#include <algorithm> // transform | #include <algorithm> // transform | ||
67번째 줄: | 67번째 줄: | ||
cout << str2 << endl; // HELLO WORLD | cout << str2 << endl; // HELLO WORLD | ||
} | } | ||
</ | </syntaxhighlight> | ||
==C#== | ==C#== | ||
[[category: Csharp]] | [[category: Csharp]] | ||
< | <syntaxhighlight lang="csharp"> | ||
"Wiki means fast?".ToUpper(); // "WIKI MEANS FAST?" | "Wiki means fast?".ToUpper(); // "WIKI MEANS FAST?" | ||
</ | </syntaxhighlight> | ||
==Excel== | ==Excel== | ||
[[category: Excel]] | [[category: Excel]] | ||
< | <syntaxhighlight lang='php'> | ||
=UPPER("Hello") | =UPPER("Hello") | ||
// HELLO | // HELLO | ||
</ | </syntaxhighlight> | ||
==Java== | ==Java== | ||
[[category: Java]] | [[category: Java]] | ||
< | <syntaxhighlight lang='java'> | ||
String str = "Hello World!"; | String str = "Hello World!"; | ||
System.out.println(str.toUpperCase()); | System.out.println(str.toUpperCase()); | ||
</ | </syntaxhighlight> | ||
==JavaScript== | ==JavaScript== | ||
[[category: JavaScript]] | [[category: JavaScript]] | ||
< | <syntaxhighlight lang='javascript'> | ||
var str = "Hello World!"; | var str = "Hello World!"; | ||
document.write( str.toUpperCase() ); | document.write( str.toUpperCase() ); | ||
</ | </syntaxhighlight> | ||
==Objective-C== | ==Objective-C== | ||
[[category: Objective-C]] | [[category: Objective-C]] | ||
< | <syntaxhighlight lang='objc'> | ||
NSString *str = @"Hello World!"; | NSString *str = @"Hello World!"; | ||
NSLog(@"%@", [str uppercaseString]; | NSLog(@"%@", [str uppercaseString]; | ||
</ | </syntaxhighlight> | ||
==Perl== | ==Perl== | ||
[[category: Perl]] | [[category: Perl]] | ||
< | <syntaxhighlight lang='perl'> | ||
$str = "Hello World!"; | $str = "Hello World!"; | ||
print uc($str); | print uc($str); | ||
</ | </syntaxhighlight> | ||
==PHP== | ==PHP== | ||
[[category: PHP]] | [[category: PHP]] | ||
< | <syntaxhighlight lang='php'> | ||
$str = "Hello World!"; | $str = "Hello World!"; | ||
echo strtoupper($str); | echo strtoupper($str); | ||
</ | </syntaxhighlight> | ||
==Python== | ==Python== | ||
{{참고|파이썬 upper()}} | {{참고|파이썬 upper()}} | ||
[[category: Python]] | [[category: Python]] | ||
< | <syntaxhighlight lang='python'> | ||
str = "Hello World!" | str = "Hello World!" | ||
print str.upper() | print str.upper() | ||
</ | </syntaxhighlight> | ||
==Ruby== | ==Ruby== | ||
[[category: Ruby]] | [[category: Ruby]] | ||
< | <syntaxhighlight lang='ruby'> | ||
str = "Hello World!" | str = "Hello World!" | ||
str2 = str.upcase | str2 = str.upcase | ||
puts str2 | puts str2 | ||
</ | </syntaxhighlight> | ||
< | <syntaxhighlight lang='ruby'> | ||
str = "Hello World!" | str = "Hello World!" | ||
str.upcase! | str.upcase! | ||
puts str | puts str | ||
</ | </syntaxhighlight> | ||
==Scheme== | ==Scheme== | ||
[[category: Scheme]] | [[category: Scheme]] | ||
< | <syntaxhighlight lang="scheme"> | ||
(use-modules (srfi srfi-13)) | (use-modules (srfi srfi-13)) | ||
(string-upcase "Wiki means fast?") ; "WIKI MEANS FAST?" | (string-upcase "Wiki means fast?") ; "WIKI MEANS FAST?" | ||
</ | </syntaxhighlight> | ||
==Windows Batch== | ==Windows Batch== | ||
< | <syntaxhighlight lang='batch'> | ||
@echo off | @echo off | ||
setlocal | setlocal | ||
154번째 줄: | 154번째 줄: | ||
set "str2=%str2:~3%" | set "str2=%str2:~3%" | ||
echo %str2% | echo %str2% | ||
</ | </syntaxhighlight> | ||
==SQL== | ==SQL== | ||
160번째 줄: | 160번째 줄: | ||
===MySQL=== | ===MySQL=== | ||
[[category: MySQL]] | [[category: MySQL]] | ||
< | <syntaxhighlight lang='sql'> | ||
SELECT UPPER( "Hello World" ); | SELECT UPPER( "Hello World" ); | ||
-- HELLO WORLD | -- HELLO WORLD | ||
</ | </syntaxhighlight> | ||
===Oracle=== | ===Oracle=== | ||
[[category: Oracle]] | [[category: Oracle]] | ||
< | <syntaxhighlight lang='sql'> | ||
SELECT UPPER('Hello World') FROM DUAL; | SELECT UPPER('Hello World') FROM DUAL; | ||
-- HELLO WORLD | -- HELLO WORLD | ||
</ | </syntaxhighlight> | ||
==같이 보기== | ==같이 보기== |
2020년 11월 2일 (월) 02:33 판
1 개요
- uc
- upcase
- upper
- uppercase
- uppercaseString
- strtoupper
- toupper
- toUpperCase
2 Bash
Bash
Copy
echo "Hello, World" | tr 'a-z' 'A-Z'
# HELLO, WORLD
3 C
C
Copy
#include <ctype.h>
#include <stdio.h>
int main(void) {
char string[] = "Wiki means fast?";
int i;
for (i = 0; i < sizeof(string); ++i) {
/* transform characters in place, one by one */
string[i] = toupper(string[i]);
}
puts(string); /* "WIKI MEANS FAST?" */
return 0;
}
4 C++

C++
Copy
#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
}
C++
Copy
#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#
C#
Copy
"Wiki means fast?".ToUpper(); // "WIKI MEANS FAST?"
6 Excel
PHP
Copy
=UPPER("Hello")
// HELLO
7 Java
Java
Copy
String str = "Hello World!";
System.out.println(str.toUpperCase());
8 JavaScript
JavaScript
Copy
var str = "Hello World!";
document.write( str.toUpperCase() );
9 Objective-C
Objective-C
Copy
NSString *str = @"Hello World!";
NSLog(@"%@", [str uppercaseString];
10 Perl
Perl
Copy
$str = "Hello World!";
print uc($str);
11 PHP
PHP
Copy
$str = "Hello World!";
echo strtoupper($str);
12 Python

Python
Copy
str = "Hello World!"
print str.upper()
13 Ruby
Ruby
Copy
str = "Hello World!"
str2 = str.upcase
puts str2
Ruby
Copy
str = "Hello World!"
str.upcase!
puts str
14 Scheme
scheme
Copy
(use-modules (srfi srfi-13))
(string-upcase "Wiki means fast?") ; "WIKI MEANS FAST?"
15 Windows Batch
batch
Copy
@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%
16 SQL
16.1 MySQL
sql
Copy
SELECT UPPER( "Hello World" );
-- HELLO WORLD
16.2 Oracle
sql
Copy
SELECT UPPER('Hello World') FROM DUAL;
-- HELLO WORLD
17 같이 보기
18 References
편집자 Jmnote
로그인하시면 댓글을 쓸 수 있습니다.
리눅스 Python 2.7 컴파일 설치 ― …리눅스 Python 2.7 컴파일 설치 ― …리눅스 Python 2.7 컴파일 설치 ― …리눅스 Python 2.7 컴파일 설치 ― …리눅스 Python 2.7 컴파일 설치 ― Jmnote리눅스 Python 2.7 컴파일 설치 ― ㅇㅇㅇ미운코딩새끼 ― 승호 도령미운코딩새끼 ― 불탄고등어미운코딩새끼 ― 김레이미운코딩새끼 ― 호박이미운코딩새끼 ― Junhg0211미운코딩새끼 ― 김왼손미운코딩새끼 ― 용딘이미운코딩새끼 ―Pinkcrimson
유기농냠냠파이썬 ― 호박유기농냠냠파이썬 ― 이에스유기농냠냠파이썬 ― 이승현파이썬 global ― Jmnote파이썬 global ― John Jeong파이썬 global ― Jmnote파이썬 global ― John Jeong파이썬 global ― John Jeong파이썬 global ― John Jeong파이썬 global ― Jmnote파이썬 global ― John Jeong