The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Replace A String With .replace() In Python

TODO: Pull subtitle into page object

Use `.replace()` to do basic text replacement in a string. For example:

code_start_default_section code_end_default_section
Results
bravo bravo alfa alfa

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Replace A String With .replace() In Python

-- p

Use `.replace()` to do basic text replacement in a string.
For example:

-- code/
-- python

example = "the quick brown fox is quick"

update = example.replace("quick", "slow")

print(update)

-- /code

-- results/

the slow brown fox is slow

-- /results

-- p

If you only want to replace a certain number, add
a third parameter with the count.

-- code/
-- python

example = 'alfa alfa alfa alfa'

update = example.replace('alfa', 'bravo', 2)

print(update)

-- /code

-- results/

bravo bravo alfa alfa

-- /results


-- categories
-- Python

-- metadata
-- date: 2022-01-07 18:13:37
-- id: 23ofrngo
-- status: published 
-- type: post
-- SCRUBBED_NEO: false
-- site: aws