开发者

looking for tool to convert unescape string to escapted string [closed]

开发者 https://www.devze.com 2023-01-03 04:35 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow qu开发者_如何学编程estions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 7 years ago.

Improve this question

i just wander where can i find a tool that takes in my case java script string that is

unescape and converting it to escaped string so i could use it as string value in c++

for example characters like " i need to convert it to \"

i need something smart and not just replace all function .


Notepad++ would do it well.

Menu TextFX > TextFX Characters > Escape...

looking for tool to convert unescape string to escapted string [closed]


Pseudo code similar to C:

while(got_input_data)
{
    char = getFirstChar();
    if(char == '\"')
    {
        putchar('\');
        putchar('\"');
    }
    else if( another character that must be escaped )
    {
        // do similar stuff
    }
    else
    {
        // simply print the char that doesn't need to be escaped
        putchar(char);
    }
}

I don't know if such tools exist but I must admit that I wrote something similar when I needed to put a html page as a string in a CGI that was written in C. Old days ...

0

精彩评论

暂无评论...
验证码 换一张
取 消