def title(word, capitalize=False):
    """Convert a string to a title format, where the words are capitalized.

    Args:
        word (str): The string to format.

    Returns:
        word (str): The formatted word.
    """
    def _capitalize(w):
        return '{0}{1}'.format(w[0].upper(), w[1:])

    if word is None:
        return ''
    words = word.split(' ')
    for i, word in enumerate(words):
        if i == 0 or capitalize:
            words[i] = _capitalize(word)
    return ' '.join(words)