0

I've been trying to wrap my head around this problem for a couple hours now and cant figure out why this weird issue happens.

When using project as the value for lstrip it works as intended but if I use project_ as the value it removes the value project_c from the string channel.

This has only happened for me with this uuid and not any others so far.

channel = 'project_cae22ac4-ac76-47e7-977e-908e117f6475'

normal_result = channel.lstrip('project')   # '_cae22ac4-ac76-47e7-977e-908e117f6475'
weird_result  = channel.lstrip('project_')  #   'ae22ac4-ac76-47e7-977e-908e117f6475'

normal_result gets set to _cae22ac4-ac76-47e7-977e-908e117f6475 which is expected.

But when I add an underscore to remove the project along with the underscore it also removes the first letter 'c' from the uuid ae22ac4-ac76-47e7-977e-908e117f6475

Dylan Larsen
  • 124
  • 1
  • 2
  • 13

0 Answers0