mirror of
https://github.com/mikefarah/yq.git
synced 2026-08-24 08:22:13 +08:00
Added string trim operator
This commit is contained in:
@@ -47,6 +47,17 @@ var stringsOperatorScenarios = []expressionScenario{
|
||||
"D0, P[], (!!str)::cat; meow; 1; ; true\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Trim strings",
|
||||
document: `[" cat", "dog ", " cow cow ", horse]`,
|
||||
expression: `.[] | trim`,
|
||||
expected: []string{
|
||||
"D0, P[0], (!!str)::cat\n",
|
||||
"D0, P[1], (!!str)::dog\n",
|
||||
"D0, P[2], (!!str)::cow cow\n",
|
||||
"D0, P[3], (!!str)::horse\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
document: `[!horse cat, !goat meow, !frog 1, null, true]`,
|
||||
|
||||
Reference in New Issue
Block a user