Results for “python replace string site:python.org”
discuss.python.org
Selective replacement of matching text in a string? - Python Help
Jan 2, 2024 ... A = df.A.apply(convert) . This will generally also be faster than using df.A.str.replace with a regex substitution.
discuss.python.org
Substring replace using variables as pattern and replace string
How would I achieve this? I have just started learning Python, so I am really a novice. I have a sample set of files and my attempt which I can send to someone who is prepared to look at it.
docs.python.org
re — Regular expression operations — Python 3.15.2 documentation
This collides with Python's usage of the same character for the same purpose in string literals; for example, to match a literal backslash, one might have to ...
docs.python.org
Regular expression HOWTO — Python 3.15.2 documentation
Returns the string obtained by replacing the leftmost non-overlapping occurrences of the RE in string by the replacement replacement. If the pattern isn’t found, string is returned unchanged.
discuss.python.org
Struggling with replace method - Python Help
Apr 8, 2024 ... First, it creates a new string with the b removed, and calls it newword , while word is unchanged. Then it creates a new string with the d ...
discuss.python.org
Help - Infinite blank input lines? - Python Help - Discussions on...
Unlike .append on a list, .replace on a string creates a new string and does not change the original string object (there are no methods for changing a string in-place).
discuss.python.org
Feature Proposal: Multi-String Replacement Using a Dictionary in ...
Oct 21, 2024 ... replace() method to allow multiple substring replacements in a string using a dictionary. Currently, .replace() accepts only two arguments ...