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