Re: Is there a string function to trim all non-ascii characters out of a string
- From: Torsten Bronger <bronger@xxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 31 Dec 2007 14:51:21 +0100
Hallöchen!
Paul McGuire writes:
On Dec 31, 2:54 am, abhishek <guptaabhishek1...@xxxxxxxxx> wrote:
Use this function --
def omitNonAscii(nstr):
sstr=''
for r in nstr:
if ord(r)<127:
sstr+=r
return sstr
<Yoda>
Learn the ways of the generator expression you must.
</Yoda>
Stupid me! How could I miss such a lovely feature in the language?
Tschö,
Torsten.
--
Torsten Bronger, aquisgrana, europa vetus
Jabber ID: bronger@xxxxxxxxxx
(See http://ime.webhop.org for further contact info.)
.
- References:
- Is there a string function to trim all non-ascii characters out of a string
- From: silverburgh.meryl@xxxxxxxxx
- Re: Is there a string function to trim all non-ascii characters out of a string
- From: abhishek
- Re: Is there a string function to trim all non-ascii characters out of a string
- From: Paul McGuire
- Is there a string function to trim all non-ascii characters out of a string
- Prev by Date: using super
- Next by Date: Re: at what complexity, a comparison fails ?
- Previous by thread: Re: Is there a string function to trim all non-ascii characters out of a string
- Next by thread: Re: Is there a string function to trim all non-ascii characters out of a string
- Index(es):