Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python join multiple strings ignore none and empty string

# Concatenates string variables a and b with ' - ' or Coalesces them if one is None
'-'.join([x for x in (a,b) if x])
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #join #multiple #strings #ignore #empty #string
ADD COMMENT
Topic
Name
1+2 =