Check if a String is Empty, NaN Value or Space - Python for Integrated Circuits - - An Online Book - |
||||||||
Python for Integrated Circuits http://www.globalsino.com/ICs/ | ||||||||
Chapter/Index: Introduction | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | Appendix | ||||||||
================================================================================= We can check if a string is empty, contains only whitespace characters, or is NaN in Python using various methods:
============================================ Check if a string is empty or not (space is not considered as empty): Code: ============================================ Get definite an answer about string empty by removing spaces first: Code: ============================================ Check if a string is empty or space: Code: ============================================ Check if a string is in NaN value: Code: ============================================
|
||||||||
================================================================================= | ||||||||
|
||||||||