input: Write a function to capitalize the first character of each word in a given string. The function should split the string into individual words, capitalize the first character of each word, and then join the words back together into a single string. If the input string is empty, the function should return an empty string.
  
  def capitalize_string(str):
      if not str:
          return ""
      words = str.split(' ')
      capitalized_words = [word.capitalize() for word in words]
      return " ".join(capitalized_words)
  
  assert capitalize_string("this is an example")=="This Is An Example"
  assert capitalize_string("hello world")=="Hello World"
  assert capitalize_string("python programming")=="Python Programming"
  assert capitalize_string("")==""
  assert capitalize_string("a b c")=="A B C"
output: def capitalize_string(str):
      if not str:
          return ""
      words = str.split(' ')
      capitalized_words = [word.capitalize() for word in words]
      return " ".join(capitalized_words)