• Skip to primary navigation
  • Skip to content
  • Skip to footer
DB 0003 Sometimes it is the people no one imagines anything of who do the things that no one can imagine

      D

      Software Developer

      • Earth

      [Python] Check Null or N/A or empty String

      less than 1 minute read

      Sample function to check if string is None or empty "" or “N/A” or “-“

      return true if str is not contains conditions.

      def is_not_blank_or_na(str):
      	return bool(str and str.strip()) and not bool(str == 'N/A' or str == '-' or str.startswith(' ') or str == 'None' or str is None)
      

      Categories: check, null, python, string

      Updated: November 25, 2021

      Share on

      X Facebook LinkedIn Bluesky
      Previous Next

      Comments

      You May Also Enjoy

      [Python] Readability

      less than 1 minute read

      Python version of Readability

      [Python] Credit Card Validation

      1 minute read

      This is a credit card validation with Luhn’s Algorithm

      [JS] Promise Basics

      less than 1 minute read

      1. Resolve case

      [Node.js] Koa Server initialization with formatter

      1 minute read

      Step 1. Setup packages required