import re


def str_to_list(word, dl=','):
  """Converts a string to a list for the given delimiter."""
  regexp = re.compile(r'['+dl+']')
  if regexp.search(word):
    x = word.split(',')
    x = [i.strip() for i in x if i.strip() ]
  else:
    x = [word]
  return x