YAML教程@第六章 YAML标量和标签

版权声明:忠于祖国,忠于人民 https://blog.csdn.net/boss2967/article/details/89554293

YAML中的标量使用文件类型以块格式编写,表示为(|)。他表示换行计数。
在YAML中,标量以折叠样式(>)书写,其中每一行表示折叠空间,其以空行或者跟多缩进结束
YAML流标量包括简单样式和引用样式。

双引号演示包括各种转义序列。符号总是折叠在结构中。
plain:
This unquoted scalar
spans many lines.
quoted: "So does this
quoted scalar.\\n"
整数标签

这些标记包含整数值,称为数字标签

canonical: 12345
decimal: +12,345
sexagecimal: 3:25:45
octal: 014
hexadecimal: 0xC
浮点数字

十进制和指数值。称他们为指数标签

canonical: 1.23015e+3
exponential: 12.3015e+02
sexagecimal: 20:30.15
fixed: 1,230.15
negative infinity: -.inf
not a number: .NaN
其他杂项标签

嵌入其中的各种整数,浮点和字符串值,称为杂项标签。

null: ~
true: y
false: n
string: '12345'

猜你喜欢

转载自blog.csdn.net/boss2967/article/details/89554293
今日推荐