? AddStringParam use " \" " and/or ' " '

0 favourites
  • 6 posts
  • It would be nice to be able to use ' " ' and/or " \" " at "AddStringParam" and other.

    At moment i have to use for example:


    That's a little crazy to write.

    And in plugin I need to String.replace() ' with " to make a valid json.

    I also can String.replace() ' in construct directly, but that makes it not better...

    I think this also help for other things as json.

    Or did I miss other options?

  • Both of these things are the standard and nature of urls and json formatting.

    Use url encoded characters

    " = %22

    \ = %2f

    Jsons use single quotations for keys so it is a restricted character. You probably will need to continue doing some creative replacing here to bypass this limitation

  • Thanks for reply, but for me it was actually about Constructs->AddStringParam with 'string', not about json.

    I know my english is not very well...

    Conversely, this will work for json, but construct dont accept:


    Other example for same situation:

    str('He said:"Hello".')

    str("He said:\"Hello\".")

    This wont work in Construct. Is working in JavaScript. Would be nice if Construct accept this.

    Or do you mean something like:



    I think that's even worse.

  • To put a " in construct you need to use ""

    "He said ""hello""."

  • WTF When I watch this, it dizzy me.

    But it seems to work and will make it more simple.

    So "" is like \".

    Thank you much, for this information!

    And with my new sprintf, status is now:


    Much better, now it is readable and no .replace needed!

    But I think furthermore, would be nice to be able to use. 'He said: "Hello".'

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ashley , is there any chance we could have es6 template strings in the editor to avoid this kind of thing?

    maybe for c3?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)