Open oldoc63 opened 1 year ago
Here we used .replace() to change every instance of a space in the string above to be an underscore instead. Note that in this example, we used a single character, but these substrings can be multiple characters long!
The poetry organization has sent over the bio for Jean Toomer as it currently exists on their site. Notice that there was a mistake with his last name and all instances of Toomer are lacking one o.
Use .replace() to change all instances of Tomer in the bio to Toomer. Save the updated bio to the string toomer_bio_fixed.
The next string method we will cover is .replace(). Replace takes two arguments and replaces all instances of the first argument in a string with the second argument.