About 12,200,000 results
Open links in new tab
  1. How to use string.replace () in python 3.x - Stack Overflow

    Feb 26, 2012 · The string.replace() is deprecated on python 3.x. What is the new way of doing this?

  2. string - Python Replace \\ with \ - Stack Overflow

    Mar 3, 2015 · Python Replace \\ with \ [duplicate] Asked 14 years, 10 months ago Modified 3 years, 7 months ago Viewed 201k times

  3. How do I replace a character in a string with another character in …

    Nov 18, 2012 · Strings in Python are immutable, so you cannot change them in place. Check out the documentation of str.replace: Return a copy of the string with all occurrences of substring …

  4. python .replace () regex - Stack Overflow

    118 In order to replace text using regular expression use the re.sub function: sub (pattern, repl, string [, count, flags]) It will replace non-everlaping instances of pattern by the text passed as …

  5. python - How to search and replace text in a file - Stack Overflow

    How do I search and replace text in a file using Python 3? Here is my code:

  6. Python string.replace regular expression - Stack Overflow

    I am using a line replace function posted previously to replace the line which uses Python's string.replace(pattern, sub). The regular expression that I'm using works for instance in vim but …

  7. Python replace string pattern with output of function

    Sep 26, 2012 · I have a string in Python, say The quick @red fox jumps over the @lame brown dog. I'm trying to replace each of the words that begin with @ with the output of a function that …

  8. python - How to replace/overwrite file contents instead of …

    When you say "replace the old content that's in the file with the new content", you need to read in and transform the current contents data = file.read(). You don't mean "blindly overwrite it …

  9. python - How to replace multiple substrings of a string ... - Stack ...

    After some benchmarking on using replace several times vs regex replacement on a string of increasing length by power of 2 with 100 replacements added, it seems that on my computer …

  10. python - rreplace - How to replace the last occurrence of an …

    Is there a quick way in Python to replace strings but, instead of starting from the beginning as replace does, starting from the end? For example: >>> def rreplace (old, new, occurrence) &...