So we know you can use characters like so "\224"
So if i wanted to write that out in a textbox that the user controls, then take that string to add that character, how would i?
It seems to refuse "/" because it is a special character (ie appears replaced by the appropriate character)
so "\" + "224"
would not work because it wont accept "\" on its own?
any ideas?
You would have to do the conversion yourself, e.g.
function convert(text) {
return text.replace(/\\([\d]+)/, function (match) {
return String.fromCharCode(match.substr(1));
});
}
This would convert a backslash followed by any numbers to the corresponding ASCII character, so convert("\\65") in JS (typed in your game that would be "\65") results in "A".
thanking you :)
@casiotone: That should probably be /\\(\d+)/g. You don't need the brackets around the \d and you need /g to replace all.
EDIT - thanks Radnen... not sure how I didn't notice that :P
Alpha: you mean @casiotone the other admin.
Alpha: you mean @casiotone the other admin.
Haha, thanks. I just saw the orange letters and assumed NEO. :P
I keep hitting modify instead of quote. I hate being an admin.
That should probably be /\\(\d+)/g. You don't need the brackets around the \d and you need /g to replace all.
whoops, yes. When I was writing it I was going to use the match group but substr on the full match was easier.
Who was casiotone on the old forums? I don't remember him.
:-X
Who was casiotone on the old forums? I don't remember him.
:-X
What reason do you have for keeping quiet? ;)
I keep hitting modify instead of quote. I hate being an admin.
Ha, tell me about it, I made the same mistake too, luckily I never committed any of those modified messages. :P
Who was casiotone on the old forums? I don't remember him.
:-X
What reason do you have for keeping quiet? ;)
I'm sure he has his reasons. :/