This sounds silly, but how does one assign a value to a char in Javascript? This gives me a compile error: Code (csharp): var character : char; character = 'g'; The error is "unexpected char '''."
The usual solution I've seen is to use the index operator on a string: Code (csharp): var c : char; c = "s"[0]; // Or when calling a .Net method that needs a // char argument; SomeDotNetClass.MethodThatTakesAChar("s"[0]);
Something has been updated regarding this question, JS has char now: function findMatchingParenthesis( str : String, openPos : int ) : int { var closePos :int = openPos; var counter :int = 1; while (counter > 0) { var c:char = str[++closePos]; if (c == '(') { counter++; } else if (c == ')') { counter--; } } return closePos; } find matching parenthesis bracket in unity3d