mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-13 22:38:04 +00:00
542 B
542 B
String Operators
Join strings
Given a sample.yml file of:
- cat
- meow
- 1
- null
- true
then
yq eval 'join("; ")' sample.yml
will output
cat; meow; 1; ; true
Split strings
Given a sample.yml file of:
cat; meow; 1; ; true
then
yq eval 'split("; ")' sample.yml
will output
- cat
- meow
- "1"
- ""
- "true"
Split strings one match
Given a sample.yml file of:
word
then
yq eval 'split("; ")' sample.yml
will output
- word