GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Processing
  • p5.js
  • Processing.py
  • Processing for Android
  • Processing for Pi
  • Processing Foundation

This view

  • Original page
  • New address

GeezerVison is showing py.processing.org — .replace() \ Language (API)

Python Mode for Processing is no longer maintained. This site is kept as an archive. Read more
  • Processing
  • p5.js
  • Processing.py
  • Processing for Android
  • Processing for Pi
  • Processing Foundation
Cover
Reference
Tutorials
Examples
Bugs
Name

.replace()

Examples
word = "cake"
print(word)  # Prints cake
word = word.replace('c', 'm')
print(word)  # Prints make
Description Returns a copy of the string with all occurrences of an old substring replaced by a new substring.
Syntax
s.replace(old, new)
Parameters
oldsubstring to replace
newsubstring to substitute old with
Related .split()
.join()
.strip()
.find()
String Formatting

Updated on Sat Oct 24 11:26:09 2026.

If you see any errors or have comments, please let us know.

Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.