Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增加 Backslash Escape/Unescape 功能 #204

Closed
bytemain opened this issue Jan 30, 2023 · 4 comments
Closed

增加 Backslash Escape/Unescape 功能 #204

bytemain opened this issue Jan 30, 2023 · 4 comments

Comments

@bytemain
Copy link

在开发中,有些文本复制出来是带 \n 的,这个时候想把 \n 去掉,有个工具的话就很方便。

Example

Input:

\n\tallow.auto.create.topics = true\n\tauto.commit.interval.ms = 5000\n\tauto.offset.reset = latest\n\tbootstrap.servers = [kafka.service.consul:9092]\n\tcheck.crcs = true\n\tclient.dns.lookup = default\n\t

Output:

	allow.auto.create.topics = true
	auto.commit.interval.ms = 5000
	auto.offset.reset = latest
	bootstrap.servers = [kafka.service.consul:9092]
	check.crcs = true
	client.dns.lookup = default
	
@bytemain
Copy link
Author

bytemain commented Jan 30, 2023

https://en.wikipedia.org/wiki/Escape_character

JavaScript uses the \ (backslash) as an escape character for:[1][2]

  • \' single quote
  • \" double quote
  • \\ backslash
  • \n new line
  • \r carriage return
  • \t tab
  • \b backspace
  • \f form feed
  • \v vertical tab (Internet Explorer 9 and older treats '\v as 'v instead of a vertical tab ('\x0B). If cross-browser compatibility is a concern, use \x0B instead of \v.)
  • \0 null character (U+0000 NULL) (only if the next character is not a decimal digit; else it is an octal escape sequence)
  • \xFF character represented by the hexadecimal byte "FF"

@bytemain
Copy link
Author

@baiy
Copy link
Owner

baiy commented Jan 30, 2023

@baiy baiy closed this as completed Jan 31, 2023
@bytemain
Copy link
Author

感谢大佬,希望之后可以更新一下 utools 插件带上这个特性

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants