Re
-
[PYTHON] split / re.splitPYTHON 2023. 10. 19. 09:59
split str = 'abcd efghi jklmno' test_str = str.split('f') print(test_str) print('test_str[0]:' + test_str[0]) print('test_str[1]:' + test_str[1]) ['abcd e', 'ghi jklmno'] test_str[0]:abcd e test_str[1]:ghi jklmno re.split import re str = 'abcd efghi jklmno' test_str = re.split('ef|jk|n',str) print(test_str) print('test_str[0]:' + test_str[0]) print('test_str[1]:' + test_str[1]) print('test_str[2..