Every line of 'python split string at index' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
113 def split(string, char): 114 """ Split a string with a char and return always two parts""" 115 string_list = string.split(char) 116 if len(string_list) == 1: 117 return None, None 118 return char.join(string_list[:-1]), string_list[-1]