About 11,800,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. How do I replace a character in a string with another character in Python?

    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 old …

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

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

  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 string.

  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 - How to replace/overwrite file contents instead of appending ...

    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 without needing …

  8. python - rreplace - How to replace the last occurrence of an expression ...

    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) &...

  9. python - How to replace text in a string column of a Pandas dataframe ...

    For anyone else arriving here from Google search on how to do a string replacement on all columns (for example, if one has multiple columns like the OP's 'range' column): Pandas has a built in replace …

  10. python - replace part of the string in pandas data frame - Stack Overflow

    I have a pandas data frame in which I need to replace one part of the string value with another string value: For example, I have: HF - Antartica HF - America HF - Asia Out of which I'd like to re...