I am not sure what you mean with "presumimng sl[2] is a string"? You control how you format the message (as string) when you send it, so it is up to your code to interpret the string returned according to the format you used for sending.
For your other question, do I understand correct you want to create an FMX client app that will connect to and use the websocket chat server?
myMessage := sl[2];
SetLength(myMessage,LENGTH(myMessage)-1) ;
WebListBox1.Items := sl;
i:= CompareStr('demo',myMessage);
if i=0 then showmessage('demo is the message');
console.log(myMessage.length);
Also can I access the chatServer created with the demo from a Delphi FMX project ?
ie the sever.exe.
If I compile this and run on my server and open the ports can I access from both TMS app & FMX app.
The built-in Delphi socket components won't work out of the box with web sockets. Either you could add this protocol on top of an indy socket component or use a component mentioned in this article: