开发者

How can I escape % characters in YAML?

How can I escape % characters 开发者_如何学Pythonin YAML?


Try %% it might work to escape.


put the string it in double quotes: "%{var} some string"


If in doubt, try converting a string to yaml in IRB

C:\Documents and Settings\a.grimm>irb
irb(main):001:0> require "yaml"
=> true
irb(main):002:0> "I'm giving it 110%!".to_yaml
=> "--- I'm giving it 110%!\n"
irb(main):003:0> exit
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜