adding characters like character 253, 254 to javascript strings

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vincent Nuijjten

    adding characters like character 253, 254 to javascript strings

    Hello,

    My question is:

    I'm adding character 253 to a javascript string this way:

    var str = '';

    str += 'a';
    str += unescape('%FD') ;
    str += 'b';

    Is there another way to do this. Is there a function like: str += char(253)
    ?

    Thanks in advance,

    Vincent



  • lallous

    #2
    Re: adding characters like character 253, 254 to javascript strings

    Hi,

    Convert the character to hex and build the string as:

    str = '\xFD\xFE';

    as \xHEXCODEHERE

    regards,
    Elias


    Comment

    Working...