开发者

How can I escape % characters in YAML?

开发者 https://www.devze.com 2023-03-06 17:22 出处:网络
How can I escape % characters 开发者_如何学Pythonin YAML?Try %% it might work to escape.put the string it in double quotes:

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

精彩评论

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

关注公众号