Question in short:
How do I compare a .NET String object with a JavaScript string or better yet: convert the one into the other?
Background:
I have a C# class handling tcp/ip socket connections. You can register functions with the class that handle incoming messages like so:
comm = new IPCommunicator("127.0.0.1", 9000);
comm.addHandler(OnMessageReceived);
function OnMessageReceived(message) {
// Handle message
}
Now, the parameter passed to OnMessageReceived by the IPCommunicator class will be of a .NET String type. Inside the handler function I wish to be able to write code like:
if(message == 'some command') {
DoSomeCommand();
}
But of course .NET Strings and javascript strings can't be compared like that.