On 2/23/06, Diez B. Roggisch <[EMAIL PROTECTED]> wrote:
> "äöü".decode("ascii")
> should do the trick -- you get an UnicodeError when there is anything ascii
> can't encode.
Thank you. This is good enought for me.
Best regards,
SB.
--
Bioinformatics news: http://www.bioinformatica.info
Lriser: ht
> How do I detect non-ascii letters in a string? I want to detect the
> condition that a string have a letter that is not here:
> string.ascii_letters
I don't know how efficient it is, but it's fairly clean:
clean_string = ''.join([c for c in some_string if c in
string.ascii_letters])
If you
Sebastian Bassi wrote:
> Hello,
>
> How do I detect non-ascii letters in a string?
> I want to detect the condition that a string have a letter that is not
> here: string.ascii_letters
"äöü".decode("ascii")
should do the trick -- you get an UnicodeError when there is anything ascii
can't encode
Sebastian Bassi wrote:
> Hello,
>
> How do I detect non-ascii letters in a string?
> I want to detect the condition that a string have a letter that is not
> here: string.ascii_letters
>
> Best regards,
> SB.
>
> --
> Bioinformatics news: http://www.bioinformatica.info
> Lriser: http://www.linspire
On Thu, 23 Feb 2006 12:32:35 -0300, Sebastian Bassi wrote:
> Hello,
>
> How do I detect non-ascii letters in a string?
> I want to detect the condition that a string have a letter that is not
> here: string.ascii_letters
for c in some_string:
if c not in string.ascii_letters:
raise V
Hello,
How do I detect non-ascii letters in a string?
I want to detect the condition that a string have a letter that is not
here: string.ascii_letters
Best regards,
SB.
--
Bioinformatics news: http://www.bioinformatica.info
Lriser: http://www.linspire.com/lraiser_success.php?serial=318
--
http