0

I'm having a weird issue with lstrip, with the following setup I get:

In[42]: file_path
Out[42]: 'C:\\Users\\User\\Documents\\Company\\MATLAB\\V_Common\\v_matlab\\V_Scripts\\Yaw\\getYaw.m'

In[43]: folder_path
Out[43]: 'C:\\Users\\User\\Documents\\Company\\MATLAB\\V_Common\\v_matlab'

In[44]: file_path.lstrip(folder_path)
Out[44]: 'Scripts\\Yaw\\getYaw.m'

Why is the 'V_' part disapearing? Doing this to a example path doesn't give the same result.

In[45]: 'C:\\a\\b\\V_\\e\\f'.lstrip('C:\\a\\b')
Out[45]: 'V_\\e\\f'

In[46]: file_path.startswith(folder_path)
Out[46]: True

In[47]: file_path[len(folder_path)+1:]
Out[47]: 'V_Scripts\\Yaw\\getYaw.m'

Is there some special functionality in lstrip that I'm missing?

Jerry
  • 563
  • 1
  • 6
  • 22

0 Answers0