Python Forum
How to remove space between strings
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to remove space between strings
#1
Hi there,
how can we remove space if there is a space between values in a string.
for example
'abcdef @gmail.com'
Reply
#2
a = 'abcdef @gmail.com'
dm = a.replace(" ","")
print(dm)
Reply
#3
.join method can do the trick.

And please - no more capslock. My eyes and ears are hurt.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Trying to understand strings and lists of strings Konstantin23 2 696 Aug-06-2023, 11:42 AM
Last Post: deanhystad
  Remove a space between a string and variable in print sie 5 1,706 Jul-27-2022, 02:36 PM
Last Post: deanhystad
  Splitting strings in list of strings jesse68 3 1,702 Mar-02-2022, 05:15 PM
Last Post: DeaD_EyE
  from global space to local space Skaperen 4 2,269 Sep-08-2020, 04:59 PM
Last Post: Skaperen
  How to give space when concaneting strings deshanish 1 1,470 Jul-15-2020, 03:08 AM
Last Post: bowlofred
  Remove space after random.randrange(1, 11) rs74 4 2,265 Jun-06-2020, 07:46 AM
Last Post: rs74
  Finding multiple strings between the two same strings Slither 1 2,478 Jun-05-2019, 09:02 PM
Last Post: Yoriz
  lists, strings, and byte strings Skaperen 2 4,181 Mar-02-2018, 02:12 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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