"Paul Hankin" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
On May 20, 5:02 pm, "Ahmed, Shakir" <[EMAIL PROTECTED]> wrote:
> I have thousands of records in MS Access database table, which records I
> am fetching using python script. One of the columns having string like
> '8 58-2155-58'
>
> Desired output: '858215558'

|def cleanup(s):
|    return filter(lambda x: x not in ' -', s)

Or
>>> s='8 58-2155-58'
>>> t=str.maketrans('','',' -')
>>> s.translate(t)
'858215558'




--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to