Python Forum
[SOLVED] Delete specific characters from string lines
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Delete specific characters from string lines
#3
I'm guessing line = line[-1] means that Python will delete the first character starting from the end?
Meaning that to delete the ones in the middle and left, I'd have to do something like line = line[-1,-20,40] assuming the zeros there are on the 20th and 40th spot.
Is this correct?
Reply


Messages In This Thread
RE: Delete specific characters from string lines - by EnfantNicolas - Oct-21-2021, 09:54 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  delete specific row of entries jacksfrustration 3 410 Feb-13-2024, 11:13 PM
Last Post: deanhystad
  doing string split with 2 or more split characters Skaperen 22 2,567 Aug-13-2023, 01:57 AM
Last Post: Skaperen
  How do I check if the first X characters of a string are numbers? FirstBornAlbratross 6 1,558 Apr-12-2023, 10:39 AM
Last Post: jefsummers
  [SOLVED] [BeautifulSoup] Why does it turn inserted string's brackets into </>? Winfried 0 1,536 Sep-03-2022, 11:21 PM
Last Post: Winfried
  [SOLVED] [BeautifulSoup] Turn select() into comma-separated string? Winfried 0 1,126 Aug-19-2022, 08:07 PM
Last Post: Winfried
  Pymysql delete specific rows in tableview stsxbel 2 1,098 Aug-18-2022, 09:50 AM
Last Post: ibreeden
  Adding string after every 3rd charater [SOLVED] AlphaInc 2 1,268 Jul-11-2022, 09:22 AM
Last Post: ibreeden
  Delete multiple lines from txt file Lky 6 2,320 Jul-10-2022, 12:09 PM
Last Post: jefsummers
  Delete empty text files [SOLVED] AlphaInc 5 1,583 Jul-09-2022, 02:15 PM
Last Post: DeaD_EyE
  Trying to delete rows above a specific datetime value cubangt 19 11,557 May-09-2022, 08:57 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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