[파이썬] - 문자열 변환 replace( )

zsunny·2022년 6월 25일
0

[Python] 문법

목록 보기
9/18

🔎 replace( )

  • 문자열 . replace(바꾸고 싶은 문자, 변경 후 문자, 횟수)
s = hello world, hello everyone

print(s.replace('hello', 'hi')		// hi world, hi everyone
print(s.replace('hello', 'hi', 1)	// hi world, hello everyone
profile
매일 성장하는 예비 웹 개발자 🌱

0개의 댓글