asked
[Renewal] Python Introduction and Web Crawling Basics Bootcamp [Python, Web, and Data Understanding Fundamentals] (Updated)
Knowledge for Crawling: Python String Functions Summary
Written on
·
257
0
안녕하세요 강사님
6분 18초 관련 질문입니다.
strip을 이용해서 문자열을 삭제하고 싶은데 앞,뒤 뿐만 아니라 "중간"에 위치한 문자열도 삭제하고 싶으면 split으로 분리한 후 삭제해야하나요?
ex)
a='99Dave99Dave99'
a.strip('99')
'Dave99Dave'
이런 경우에서요!
Answer 2
앗 엄청 간단했네요 감사합니다 :)
안녕하세요~,
replace() 를 사용하니 깔끔하게 해결되네요.
print(a.replace("99", ""))