title: Use return value of a function as a string in Angular 2
body: <p>This is the markup I want to place the returned value:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;h2&gt;{{getSelectedUserName}}&lt;/h2&gt;
  </code></pre>
  
  <p>This is the function I want to use, which returns a string:</p>
  
  <pre class="lang-typescript prettyprint-override"><code>public getSelectedUserName(): string {
      let firstName = this.selectedUser.name.split("\\s+")[0];
  
      console.log(this.selectedUser.name.split("\\s+"));
      console.log(firstName);
      return firstName;
  }
  </code></pre>