파이썬 문자열을 대문자로 분할
예를 들어 분할하고 싶습니다. 'TheLongAndWindingRoad' at any occurrence of an uppercase letter (possibly except the first), and obtain [ 'The', 'Long', 'And', 'Winding', 'Road'] . 편집 : 또한 단일 발생을 분할해야합니다. from 'ABC' I'd like to obtain [ 'A', 'B', 'C'] . 해결 방법 >>> import re >>> re.findall('[A-Z][^A-Z]*', 'TheLongAndWindingRoad') ['The', 'Long', 'And', 'Winding', 'Road'] >>> re.findall('[A-Z][^A-Z]*', 'ABC') ['..
2020. 12. 18.