Strings and chars in JS

Hello there,
I’m very new to these forums, and Unity. First of all, I’d like to say I’m really enjoying using Unity so far and I definitely intend to become an expert user. This is an engine that everyone should at least give a try.
So, onto the problem at hand. For some reason, it seems impossible to access the String class in Javascript from Unity. What I ultimately want to do is what an itoa() function does (convert int to char or string using ASCII keycodes). There is a fromCharCode() function in the String class of JS that would do exactly what I want, but Unity script compiler complains when I try to use it.
So I looked for alternate solutions. I wanted to see if the “string” class that seems to be a native Unity class had any similar functionality (things like the name variable of GameObjects are of type “string”, afaik). Unfortunately, I was unable to find any documentation for the functionality of the “string” class.
Does anyone have any advice regarding this situation? I’m not new to programming (I’ve experience with Java, C++, C#) but I am new to Unity and scripting in Unity.
Any and all advice/comment is greatly appreciated.
Thanks.

The string class in Unity’s Javascript is the standard .Net String class. The same as in C#.

See: http://www.go-mono.com/docs/index.aspx?link=T%3ASystem.String

So, just to make sure, JS classes aren’t available to use in Unity but all the .NET classes are?

No, DOM classes aren’t available. There’s no document.getElementsById(). Why would there be?

JavaScript itself has very few predefined classes, and these are either replaced with .NET classes (String, Mathf) or augmented (Array).

Ok, thanks :slight_smile:
It was a little confusing at first, using JS with .NET classes and so forth but I got the gist of it in the end. One somewhat related question I have is, I can’t seem to use the name of my JS script as a type when scripting in C#. What I mean is:
-I have a JS script named PlayerController
-In my C# script file, I do:

PlayerController pcscript;
pcscript = GameObject.Find("Player").GetComponent(PlayerController);

Unity script compiler doesn’t like this. How do I specify the type of PlayerController? Do I have to use MonoBehaviour (every JS script creates a class that derives from MonoBehaviour right?)

Thanks.