title: How to use substring() when the string has a space in it
body: <p>I have a string containing a person's first and last name such as <code>John Doe</code>. I would like to convert this string to <code>John D.</code> Normally, I would just use <code>substring(0,1)</code> on the last name variable, but how can I achieve this when the first and last name are one string with a space in between?</p>