yaml

yaml中的三種數據類型javascript

  • map類型
name: vaadhoo
age: 24
複製代碼
  • list類型
- python
- javascript
- perl
複製代碼
  • scalar純量
# 數值
price: 12.34
# 布爾值
enable: true
# 字符串
content: "this is the content"
# null值
append: ~
複製代碼

map和list的幾種組合嵌套java

  • map-map嵌套
website:
 yaml: yaml.org
 python: python.org
 perl: use.perl.org
複製代碼
  • map-list嵌套
website:
 - yaml
 - python
 - perl
 - javascript
複製代碼
  • list-list嵌套
-
 - item11
 - item12
-
 - item21
 - item22
複製代碼
  • list-map嵌套
-
 name: vaadhoo
 age: 19
-
 name: steven
 age: 24
複製代碼

字符串python

字符串默認不使用引號,若是包含空格或者特殊字符須要放在引號中web

str: 'this is a string.'
複製代碼

引號分爲單雙引號,單引號時候會將特殊字符進行轉義,雙引號則默認不轉義bash

s1: 'content\nsome content'
s2: "content\nsome content"
複製代碼

多行字符串,換行開始必須有一個單空格縮進,換行符會被轉爲空格app

str:
 this is a
 multi-line
 string
複製代碼

字符串配合|符號的一些操做ui

s1: |
 Foo
 Bar
s2: |+
 Foo
s3: |-
 Foo
s4: >
 Foo
 Bar
複製代碼
相關文章
相關標籤/搜索