Asked By – grigoryvp
I have some simple python code that searches files for a string e.g.
path=c:\path, where the
c:\path part may vary. The current code is:
def find_path(i_file): lines = open(i_file).readlines() for line in lines: if line.startswith("Path="): return # what to do here in order to get line content after "Path=" ?
What is a simple way to get the text after
Now we will see solution for issue: How to remove the left part of a string?
Python 3.9, you can use
'Path=helloworld'.removeprefix('Path=') # 'helloworld'