转义字符串

把特殊字符写成转义序列,便于在字符串或源码中表示。

输入: 文本结果: 文本

文本输入

工具选项

案例

Represent 'He said "hello".' as a JSON string

输入

He said "hello".

Expected answer

"He said \"hello\"."
转义级别
Minimal
转义引号
Double
兼容 JSON
On
兼容 ES6
On
大写十六进制
Off
Represent 'C:\\logs\\release.txt' as a JSON string

输入

C:\logs\release.txt

Expected answer

"C:\\logs\\release.txt"
转义级别
Minimal
转义引号
Double
兼容 JSON
On
兼容 ES6
On
大写十六进制
Off
Represent 'line one\nline two' as a JSON string

输入

line one
line two

Expected answer

"line one\nline two"
转义级别
Minimal
转义引号
Double
兼容 JSON
On
兼容 ES6
On
大写十六进制
Off
Represent 'tab\tseparated' as a JSON string

输入

tab	separated

Expected answer

"tab\tseparated"
转义级别
Minimal
转义引号
Double
兼容 JSON
On
兼容 ES6
On
大写十六进制
Off
Represent "single quote: '" as a JSON string

输入

single quote: '

Expected answer

"single quote: '"
转义级别
Minimal
转义引号
Double
兼容 JSON
On
兼容 ES6
On
大写十六进制
Off
complex

输入

4ec985786aa10a7515d8be2d.bin

115 bytes

下载

Expected answer

null\0backspace\btab\tnewline\nverticaltab\x0bformfeed\fcarriagereturn\rdoublequote"singlequote\'hex\xa9unicode\u2665codepoint\u{1d306}
转义级别
Special chars
转义引号
Single
兼容 JSON
Off
兼容 ES6
On
大写十六进制
Off
double quotes

输入

Hello "World"!

Expected answer

Hello \"World\"!
转义级别
Special chars
转义引号
Double
兼容 JSON
Off
兼容 ES6
On
大写十六进制
Off
single quotes

输入

Escape 'these' quotes.

Expected answer

Escape \'these\' quotes.
转义级别
Special chars
转义引号
Single
兼容 JSON
Off
兼容 ES6
On
大写十六进制
Off
special characters

输入

1203ab8e4358d1fe9949e85d.bin

100 bytes

下载

Expected answer

Fizz & buzz\n\ttabbed newline\rcarriage returned line\nbackspace character: \"\b\" form feed character: \"\f\"
转义级别
Special chars
转义引号
Double
兼容 JSON
Off
兼容 ES6
On
大写十六进制
Off

参数

参数默认值输入与选项
转义级别Special 字符Special 字符, Everything, Minimal
转义引号SingleSingle, Double, Backtick
兼容 JSONfalse开启或关闭
兼容 ES6true开启或关闭
大写十六进制false开启或关闭

相关工具

实用工具

操作参考

查看原始技术文档 (English)