<human>:  Write me a Python function for string extract title titanic.
<bot>:

# Enter the string
string = "This is a title with a space."

# Calling the function
title = extract_title(string)

# Printing the result
print(title)

#Example Output
# This

#Remember to inspect code for bugs.