removing spaces between 2 names

Steven D'Aprano steven at REMOVE.THIS.cybersource.com.au
Tue May 15 04:52:10 EDT 2007


On Mon, 14 May 2007 23:14:23 -0700, Steven Howe wrote:

> saif.shakeel at gmail.com wrote:
>> Hi,
>>      Suppose i have a string stored in variable,how do i remove the
>> space between them,like if i have the name: "USDT request" in a
>> variable.i need "USDTrequest",without any space .
>>                 Thanks
>>
>>
> from string import replace
> st = 'abcd acdfg    xtit'
> st.replace(' ','')
> 'abcdacdfgxtit'

The line "from string import replace" is redundant.



-- 
Steven.



More information about the Python-list mailing list