I am having a difficult time initializing an array of char to use in String.Trim member function in Unityscript. At a high level I am just trying to remove any trailing carriage returns from a string. This should be a no brainer but I have tried different methods to no avail -
for example this -
var charsToTrim : char = [’
‘,’\r’];
chatTextAreaString.Trim(charsToTrim);
results in this error - Assets/Scripts/GameGUI.js(300,60): BCE0022: Cannot convert 'String[]' to 'char[]'.
and this - var charsToTrim : char[] = new char[1]; charsToTrim[1] = ' '; chatTextAreaString.Trim(charsToTrim);
results in this error - Assets/Scripts/GameGUI.js(261,50): BCE0022: Cannot convert 'String' to 'char'.
The root of the issue is that I need to understand the syntax and caveats of using different types of arrays in Unityscript and haven't found a comprehensive source for this.
Any help with my immediate problem would be appreciated and if anyone has a source where I can read up on Unityscript array syntax would also be great.