Re: [Tutor] function for removing all white spaces from a string

2007-10-01 Thread Ricardo Aráoz
Tim wrote: > Hello, > after reading the responses to athread in 2004 [1] I am wondering why there is > no easy function in python to remove all white spaces from a string. > > Like: > > " i am very fine " > to > "iamveryfine" > > In IDL there's just one simple function which does this: STRCOMPRE

Re: [Tutor] function for removing all white spaces from a string

2007-10-01 Thread Bill Campbell
On Mon, Oct 01, 2007, Alan Gauld wrote: > >"Tim" <[EMAIL PROTECTED]> wrote > >> after reading the responses to athread in 2004 [1] I am wondering >> why there is >> no easy function in python to remove all white spaces from a string. >> >> " i am very fine " >> to >> "iamveryfine" > >You can use s

Re: [Tutor] function for removing all white spaces from a string

2007-10-01 Thread Alan Gauld
"Tim" <[EMAIL PROTECTED]> wrote > after reading the responses to athread in 2004 [1] I am wondering > why there is > no easy function in python to remove all white spaces from a string. > > " i am very fine " > to > "iamveryfine" You can use string.replace. >>> 'I am very fine'.replace(' ','')