Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
489 views
in Technique[技术] by (71.8m points)

string - 如何将字符串分成多行?(How do I break a string over multiple lines?)

In YAML, I have a string that's very long.

(在YAML中,我的字符串很长。)

I want to keep this within the 80-column (or so) view of my editor, so I'd like to break the string.

(我想将其保留在编辑器的80列(或类似视图)内,所以我想破坏字符串。)

What's the syntax for this?

(这是什么语法?)

In other words, I have this:

(换句话说,我有这个:)

Key: 'this is my very very very very very very long string'

and I'd like to have this (or something to this effect):

(我想要这个(或达到这种效果的东西):)

Key: 'this is my very very very ' +
     'long string'

I'd like to use quotes as above, so I don't need to escape anything within the string.

(我想使用上述引号,因此不需要在字符串中转义任何内容。)

  ask by jjkparker translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to reply this article.

OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...