title: Extract substring from index 0 up to searched character
body: <p>I have an object called <code>user</code>. I can get its name by <code>user.name</code>, and its value has both the first name and last name such as <code>Jon Doe</code>. What is the most efficient and elegant way of grabbing the first character up until the space character so that I get <code>Jon</code>?</p>