Python Forum
doing string split with 2 or more split characters
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
doing string split with 2 or more split characters
#9
(Aug-04-2023, 03:27 PM)Pedroski55 Wrote: Oh yes, but then you have imported re to do the work, which is, possibly, somewhat longer than 1 line!
Did you not 👀 the first one.
''.join(c if not c in '|!' else ' ' for c in s).split()
Reply


Messages In This Thread
RE: doing string split with 2 or more split characters - by snippsat - Aug-04-2023, 04:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] Class and methods ebn852_pan 15 816 May-23-2024, 11:57 PM
Last Post: ebn852_pan
  Class test : good way to split methods into several files paul18fr 4 619 Jan-30-2024, 11:46 AM
Last Post: Pedroski55
  [split] Pipenv mohammadasadi4 0 346 Jan-15-2024, 10:35 AM
Last Post: mohammadasadi4
  [split] Why is there an output of None akbarza 1 546 Nov-27-2023, 02:53 PM
Last Post: deanhystad
  [split] Class takes no arguments bily071 2 721 Oct-23-2023, 03:59 PM
Last Post: deanhystad
  [split] Issue installing selenium Akshat_Vashisht 1 620 Oct-18-2023, 02:08 PM
Last Post: Larz60+
Sad How to split a String from Text Input into 40 char chunks? lastyle 7 1,296 Aug-01-2023, 09:36 AM
Last Post: Pedroski55
  How to "tee" (=split) output to screen and into file? pstein 6 1,528 Jun-24-2023, 08:00 AM
Last Post: Gribouillis
  [split] How to resolve version conflicts in Python? atonalwilson 1 1,066 May-04-2023, 09:02 AM
Last Post: buran
  How do I check if the first X characters of a string are numbers? FirstBornAlbratross 6 1,662 Apr-12-2023, 10:39 AM
Last Post: jefsummers

Forum Jump:

User Panel Messages

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