Hallo,

I have a unicode string s, for example u"abc", u"äöü", u"123" or something else, and I have to find out wether

1. s is not empty and contains only digits (as in u"123", but not in u"3.1415")

or

2. s is empty or contains only whitespaces

For all other cases I would assume a "normal" unicode string in s, whatever that may be.

For the first case it could be s.isdigit(), s.isnumeric() or s.isdecimal() - but which one is the best?

For the second case it should be s.isspace(), but it works only on strings, not on unicode strings?

Many thanks for any help!

Ulrich


--
Ulrich Goebel
Paracelsusstr. 120, 53177 Bonn
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to