강의

멘토링

커뮤니티

Inflearn Community Q&A

kimseohyun89051513's profile image
kimseohyun89051513

asked

[Renewal] Python Introduction and Web Crawling Basics Bootcamp [Python, Web, and Data Understanding Fundamentals] (Updated)

Knowledge for Crawling: Python String Functions Summary

strip관련 질문입니다.

Written on

·

257

0

안녕하세요 강사님

6분 18초 관련 질문입니다.

strip을 이용해서 문자열을 삭제하고 싶은데 앞,뒤 뿐만 아니라 "중간"에 위치한 문자열도 삭제하고 싶으면 split으로 분리한 후 삭제해야하나요?

ex)

a='99Dave99Dave99'

a.strip('99')

'Dave99Dave'

이런 경우에서요!

python웹-크롤링

Answer 2

0

앗 엄청 간단했네요 감사합니다 :)

0

안녕하세요~,

replace() 를 사용하니  깔끔하게 해결되네요.

a='99Dave99Dave99'

print(a.replace("99", ""))

kimseohyun89051513's profile image
kimseohyun89051513

asked

Ask a question