"함수 ucfirst()"의 두 판 사이의 차이

26번째 줄: 26번째 줄:
==같이 보기==
==같이 보기==
* [[함수 capitalize()]]
* [[함수 capitalize()]]
* [[함수 ucwords()]]

2018년 8월 19일 (일) 02:02 판

1 개요

함수 ucfirst()
  • "uppercase first"
  • 첫글자를 대문자로 바꾸는 함수

2 Perl

print ucfirst('hello world!');
# Hello world!

3 Python

s = 'hello world!'
print ( s[0].upper() + s[1:] )
# Hello world!
s = 'HELLO WORLD!'
print ( s[0].upper() + s[1:] )
# HELLO WORLD!

4 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}