3 ms·
this is one smart 5 year old: what does this do re.sub(r"^[:;]+$", "", string) This code takes a string (a piece of text) and removes any bit at the start and
by sharemywin 4y ago
this is one smart 5 year old:
what does this do re.sub(r"^[:;]+$", "", string)
This code takes a string (a piece of text) and removes any bit at the start and end of the string that is made up entirely of the characters : or ;. So if you have a string like "Hello :;:;;" then this code will remove the :;:; and it will just be left with "Hello".