下列...
require 'yaml'
test = "I'm a b&d string"
File.open('test.yaml', 'w') do |out|
out.write(test.to_yaml)
end
Run Code Online (Sandbox Code Playgroud)
......输出......
--- this is a b&d string
Run Code Online (Sandbox Code Playgroud)
我怎样才能输出它
--- 'this is a b&d string'
Run Code Online (Sandbox Code Playgroud)
???