Python Forum
Remove special character from list
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Remove special character from list
#4
Before the loop through ch in element, replace any instance of "n't" with something improbable like 'nzxzt'. Then after that loop, but before you append to results, replace 'nzxzt' with "n't". This can easily be done with the replace method of strings.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Remove special character from list - by vestkok - Nov-04-2018, 11:59 AM
RE: Remove special character from list - by vestkok - Nov-04-2018, 12:36 PM
RE: Remove special character from list - by ichabod801 - Nov-04-2018, 01:48 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to remove extra space from output list? longmen 3 1,794 May-05-2022, 11:04 PM
Last Post: longmen
  Change each character of list into an different characters Angry_bird89 1 2,064 Jun-19-2020, 08:29 AM
Last Post: Angry_bird89
  Exercise list remove duplicates RavCOder 9 5,287 Oct-23-2019, 04:16 PM
Last Post: jefsummers
  Search character from 2d list to 2d list AHK2019 3 2,508 Sep-25-2019, 08:14 PM
Last Post: ichabod801
  Unexpected character after line continuation character joshyb123 5 10,651 Sep-05-2018, 08:08 AM
Last Post: perfringo
  unexpected character after line continuation character error newbie 10 14,668 Aug-09-2018, 06:07 PM
Last Post: nilamo
  How to keep duplicates and remove all other items in list? student8 1 4,947 Oct-28-2017, 05:52 AM
Last Post: heiner55

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020