Python: Remove Leading Characters from String ('alok' to 'alok')
You can use slicing to remove the first three characters and get 'alok':
string = 'a\nb\nc\nalok'
result = string[6:]
print(result) # Output: 'alok'
原文地址: https://www.cveoy.top/t/topic/lOM1 著作权归作者所有。请勿转载和采集!