파이썬 ucfirst()

1 개요[ | ]

파이썬 ucfirst()
  • 내장 함수 아님
  • 문자열의 첫글자는 대문자로 변환하고, 나머지는 그대로 둔다.
Python
Copy
s = 'hello world!'
print ( s[0].upper() + s[1:] ) # Hello world!
Loading
Python
Copy
s = 'HELLO WORLD!'
print ( s[0].upper() + s[1:] ) # HELLO WORLD!
Loading

2 같이 보기[ | ]