You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This should have the same semantics as the stdlibstring.replace():
string.replace(s, old, new[, maxreplace])
Return a copy of string s with all occurrences of substring old replaced by new.
If the optional argument maxreplace is given, the first maxreplace occurrences are replaced.
This is more or less what subs() does but subs is too complex for my case and I do not need recursivity.
I need a simpler lower level way to do only one replacement at a time and not many. There are a few wrinkles in the subs code too where iterating on items() could be replaced by a cleaner and more efficient get() that could be cleaned up too.
The text was updated successfully, but these errors were encountered:
* the subs methods does exactly what is needed in #66. This just adds
some comments and update the name of a few variables to better
explain the substition processing.
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This should have the same semantics as the stdlib
string.replace()
:This is more or less what
subs()
does but subs is too complex for my case and I do not need recursivity.I need a simpler lower level way to do only one replacement at a time and not many. There are a few wrinkles in the subs code too where iterating on
items()
could be replaced by a cleaner and more efficientget()
that could be cleaned up too.The text was updated successfully, but these errors were encountered: