mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-12 13:48:06 +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