Bottom Page

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'
Yoriz wrote May-03-2019, 12:53 PM:
Please don't use CAPS to write your whole post and title.
Quote
#2
a = 'abcdef @gmail.com'
dm = a.replace(" ","")
print(dm)
Yoriz wrote May-03-2019, 12:54 PM:
Please post all code, output and errors (in it's entirety) between their respective tags. I did it for you this time, Here are instructions on how to do it yourself next time.
sunnyarora likes this post
Quote
#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.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Remove space after random.randrange(1, 11) rs74 4 185 Jun-06-2020, 07:46 AM
Last Post: rs74
  Finding multiple strings between the two same strings Slither 1 540 Jun-05-2019, 09:02 PM
Last Post: Yoriz
  lists, strings, and byte strings Skaperen 2 1,548 Mar-02-2018, 02:12 AM
Last Post: Skaperen

Forum Jump:


Users browsing this thread: 1 Guest(s)