cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
lala
Level VII

How to use JSL to replace characters with special symbols in ""?

[{"ReqId":"200904","PoolId":"2001"}]

How to

[{\!"ReqId\!":\!"200904\!",\!"PoolId\!":\!"2001\!"}]

Thanks!

6 REPLIES 6
lala
Level VII

回复: How to use JSL to replace characters with special symbols in ""?

txt=Get Clipboard();
tx=Substitute(txt,"\!"","/\!\!"");//??

2023-10-17_18-47-56.png

jthi
Super User

Re: How to use JSL to replace characters with special symbols in ""?

I'm not sure what you want to replace and with what (which is start and which is end?). When you are printing strings which contain quotes, usually using Write() is a good idea so you don't see the JMP's escaped quotes

Names Default To Here(1);

str = "\[test: "text"]\";

Show(str); // str = "test: \!"text\!"";
Write("\!N");
Write(str); // test: "text"
-Jarmo
lala
Level VII

Re: How to use JSL to replace characters with special symbols in ""?

Thanks!

I see

copy this

[{\!"ReqId\!":\!"200904\!",\!"PoolId\!":\!"2001\!"}]

can see

2023-10-18_7-16-47.png

 

lala
Level VII

Re: How to use JSL to replace characters with special symbols in ""?

txt=Get Clipboard();
tx=Substitute(txt,"\!"","\!\!\!"");
lala
Level VII

Re: How to use JSL to replace characters with special symbols in ""?

  • Where can I see this syntax?

  • Thanks!
jthi
Super User

Re: How to use JSL to replace characters with special symbols in ""?

Try something like

Names Default To Here(1);

// [{\!"ReqId\!":\!"200904\!",\!"PoolId\!":\!"2001\!"}]

txt = Get Clipboard();
// Write(txt);

tx = Substitute(txt,"\!"","\!\!\!"");
// write(tx);

txt2 = "\!"ReqId\!"";
// Write(txt2);

tx2 = Substitute(txt, "\!\!", "");
// Write(tx2);

tx3 = Substitute(Get Clipboard(), "\!\!", "");
// Write(tx3);

Reading about JMP's escape sequences can also be helpful Scripting Guide > JSL Building Blocks > JSL Syntax Rules 

-Jarmo