Fredrik Lundh wrote: > so, which one is correct ? > > Python 2.4.3 > >>> "".replace("", "a") > '' > >>> u"".replace(u"", u"a") > u'a' Probably there shouldn't be any "correct" in this case, i.e. the result of replacing an empty string should be undefined (because any string contains infinitely many empty substrings). +0 on raising an exception if you try. -- Greg
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4