So I have a string (a room description) and would like to replace part <?player>
of it with some new string (req.session.player
).
Here is the code:
var description = "<?player>, you are in a room.";
description.replace("<?player>", req.session.player);
I have tested and the req.session.player
does have string value.
When I do the replace method nothing changes.
NOTE: I have also tried using /<?player>/
and this did not work either.
Any ideas?