title: How do I get the last character of a string?
body: <p>How do I get the last character of a string?</p>
  <pre><code>public class Main {
      public static void main(String[] args)  {
          String s = &quot;test string&quot;;
          //char lastChar = ???
      }   
  }
  </code></pre>