Python Forum
Splitting strings in list of strings
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Splitting strings in list of strings
#1
Hi, trying to figure this one out which I expect should be easy. If I find my own solution before anyone else I'll post it here. I'm looking. Thanks

I have successfully split my line for values that were in quotes:

"val_1: val_2" "val_3: val_4" "val_5: val_6"

Now I have a list that contains: (which I think is a list of strings)

[ 'val_1: val_2' , 'val_3: val_4' , 'val_5: val_6']
How can I print the 2nd value in the pair separated by the colon :

To produce:

val_2 , val_4, val_6
Reply


Messages In This Thread
Splitting strings in list of strings - by jesse68 - Mar-02-2022, 04:38 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can you explain the strings in Python ebn852_pan 3 276 May-19-2024, 08:36 AM
Last Post: Pedroski55
Information Do regular expressions still need raw strings? bobmon 3 424 May-03-2024, 09:05 AM
Last Post: rishika24
  [SOLVED] Pad strings to always get three-digit number? Winfried 2 464 Jan-27-2024, 05:23 PM
Last Post: Winfried
  Tab Delimited Strings? johnywhy 7 737 Jan-13-2024, 10:34 PM
Last Post: sgrey
Question [PyMuPDF] Grab all strings of a given size? Winfried 3 771 Dec-26-2023, 07:39 AM
Last Post: Pedroski55
  How to read module/class from list of strings? popular_dog 1 558 Oct-04-2023, 03:08 PM
Last Post: deanhystad
  Hard time trying to figure out the difference between two strings carecavoador 2 748 Aug-16-2023, 04:53 PM
Last Post: carecavoador
  Trying to understand strings and lists of strings Konstantin23 2 896 Aug-06-2023, 11:42 AM
Last Post: deanhystad
  problem in using int() with a list of strings akbarza 4 843 Jul-19-2023, 06:46 PM
Last Post: deanhystad
  Taking Mathematical Expressions from Strings quest 2 781 Jul-02-2023, 01:38 PM
Last Post: Pedroski55

Forum Jump:

User Panel Messages

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