문제

I'm parsing a bunch of files for specific urls..

The subdirectory can be upper-case, lower-case or camel-case in these:

search = "http://website.com/content/" + subdirectory + "/?"
begin = contents.rfind(search)

It would be great for this to work regardless of the case of the sub-directory.

도움이 되었습니까?

해결책

begin = contents.lower().rfind(search.lower())
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top