Python Forum
How to find the first and last of one of several characters in a list of strings?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to find the first and last of one of several characters in a list of strings?
#2
you can use re module
you can iterate over each string and find at what position is the first/last char
if start and end chars are always '-' you can lstrip/rstrip it and see the change in len
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
RE: How to find the first and last of one of several characters in a list of strings? - by buran - Jun-02-2020, 04:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to read module/class from list of strings? popular_dog 1 494 Oct-04-2023, 03:08 PM
Last Post: deanhystad
  Program to find Mode of a list PythonBoy 6 1,151 Sep-12-2023, 09:31 AM
Last Post: PythonBoy
  Trying to understand strings and lists of strings Konstantin23 2 790 Aug-06-2023, 11:42 AM
Last Post: deanhystad
  problem in using int() with a list of strings akbarza 4 728 Jul-19-2023, 06:46 PM
Last Post: deanhystad
  Delete strings from a list to create a new only number list Dvdscot 8 1,571 May-01-2023, 09:06 PM
Last Post: deanhystad
  find random numbers that are = to the first 2 number of a list. Frankduc 23 3,269 Apr-05-2023, 07:36 PM
Last Post: Frankduc
  Help with Logical error processing List of strings dmc8300 3 1,104 Nov-27-2022, 04:10 PM
Last Post: Larz60+
  Find (each) element from a list in a file tester_V 3 1,247 Nov-15-2022, 08:40 PM
Last Post: tester_V
  read a text file, find all integers, append to list oldtrafford 12 3,653 Aug-11-2022, 08:23 AM
Last Post: Pedroski55
  find some word in text list file and a bit change to them RolanRoll 3 1,567 Jun-27-2022, 01:36 AM
Last Post: RolanRoll

Forum Jump:

User Panel Messages

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