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

Life of Brian: Conjugate the verb, "to go" !
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  weird result trying to remove numbers from a list Exsul 2 84 Aug-21-2019, 06:45 AM
Last Post: perfringo
  How to remove multiples in a list jasper100125 6 180 Aug-20-2019, 06:38 AM
Last Post: buran
  modifying variables in local or global space Skaperen 2 80 Aug-14-2019, 07:13 AM
Last Post: Skaperen
  remove weekends from matplot mr_byte31 3 202 Aug-10-2019, 08:37 AM
Last Post: DeaD_EyE
  building functions to validate strings , date etc metro17 2 140 Aug-08-2019, 12:42 PM
Last Post: ichabod801
  pickle docs say bytes in one place, strings in another Skaperen 2 95 Jul-29-2019, 05:13 PM
Last Post: Skaperen
  remove underline from hyperlink in excel SriMekala 0 86 Jul-25-2019, 01:58 PM
Last Post: SriMekala
  extract from strings some parts dervast 1 153 Jul-04-2019, 09:44 PM
Last Post: Axel_Erfurt
  How to remove empty struct from matlab file in python? python_newbie09 0 176 Jun-25-2019, 12:13 PM
Last Post: python_newbie09
  Distilling strings using .writelines() and .read() tedie 1 137 Jun-24-2019, 09:56 PM
Last Post: micseydel

Forum Jump:


Users browsing this thread: 1 Guest(s)