함수 ucfirst()

Jmnote (토론 | 기여)님의 2018년 8월 19일 (일) 02:01 판

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 }}