[Solved] Replacing part of string python [closed]
For the simplest case, you might solve this with a regular expression: >>> import re >>> re.sub(r”(‘?null’?)”, “‘Null'”, “{‘abcd’: null}”) “{‘abcd’: ‘Null’}” >>> re.sub(r”(‘?null’?)”, “‘Null'”, “{‘abcd’: ‘null’}”) “{‘abcd’: ‘Null’}” >>> but from the look of you example and the comment (which should really be part of your question) mentionning you might have a lot more … Read more