How to check if text is "empty" (spaces, tabs, newlines) in Python?

Posted by bodacydo on Stack Overflow See other posts from Stack Overflow or by bodacydo
Published on 2010-03-08T22:29:25Z Indexed on 2010/03/08 22:36 UTC
Read the original article Hit count: 496

Filed under:
|
|
|
|

How can I test if the string is empty in Python?

For example,

"<space><space><space>" is empty, so is

"<space><tab><space><newline><space>", so is

"<newline><newline><newline><tab><newline>", etc.

© Stack Overflow or respective owner

Related posts about space

Related posts about tab