title: NSString.toString returns null-terminated string
body: <p>In Nativescript I have a plugin that use NSString methods and I want to return a javascript String. If I run <code>nsstringInstance.toString()</code> I get a null-terminated javascript string. I can work around it by removing all \0-characters from the end of the string. Is there a better way to do it?</p>
  
  <pre><code>function base64_decode(base64string) {
      let nsdata = NSData.alloc().initWithBase64EncodedStringOptions(base64string, opts);
      return NSString.alloc().initWithDataEncoding(nsdata, NSUTF8StringEncoding).toString();
  }
  </code></pre>
  
  <p>I can fix this by using this </p>
  
  <pre><code>let decoded = base64_decode("SOME BASE64 STRING").replace(/\0+$/,'');
  </code></pre>
  
  <p>Is this the only way, or is there a NSString method to return UTF-8 string that is not null-terminated?</p>