Substring Index Python Find And Replace Line