toExternal Summary Converts the string value to its equivalent external value. Usage public override external toExternal() Returns The string value held by the System.String object. Description Converts the string value to its equivalent external value. Examples Basic Usage 1234567891011121314151617181920import System; external mysql = { query: function(q, a) { Console.log(q, a); } }; // Constrain type arguments to only classes that can convert to 'external'interface ICommand<T: IExportable>{ void execute(...T args);} class CreateUser : ICommand<String>{ final void execute(...String args) { string username = args[0] ?? ""; mysql.query("INSERT INTO `users`(`username`) VALUES(?);", username.toExternal()); }} auto createUserCommand = new CreateUser();createUserCommand.execute("foo"); // "INSERT INTO `users`(`username`) VALUES(?); foo" Share HTML | BBCode | Direct Link