diff options
author | Stephen Roantree <stroantree@gmail.com> | 2012-10-24 11:42:25 -0700 |
---|---|---|
committer | Stephen Roantree <stroantree@gmail.com> | 2012-10-24 13:50:26 -0700 |
commit | 5e25c2a259d2337d38b730d5dc22e7db67ea88cb (patch) | |
tree | bf0d88fdad29f2fa9ea25a3ae5de73c8ea7c2297 /docs | |
parent | 033d9b2fd55b1fef0f17ce91d864c55e07f3ee5d (diff) |
Implemented contains operator
Diffstat (limited to 'docs')
-rw-r--r-- | docs/content/3.manual/manual.yml | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/docs/content/3.manual/manual.yml b/docs/content/3.manual/manual.yml index 6c107700..437afdff 100644 --- a/docs/content/3.manual/manual.yml +++ b/docs/content/3.manual/manual.yml @@ -522,7 +522,33 @@ sections: - program: '.[] == 1' input: '[1, 1.0, "1", "banana"]' output: ['[true, true, false, false]'] - + - title: `contains` + body: | + + The expression 'a contains b' will produce true if b is completely + contained within a. A string B is contained in a string A if B is a + substring of A. An array B is contained in an array A is all elements + in B are contained in any element in A. An object B is contained in + object A if all of the values in B are contained in the value in A with + the same key. All other types are assumed to be contained in each other + if they are equal. + + examples: + - program: '. == contains "bar"' + input: '"foobar"' + output: ['true'] + - program: '. contains ["baz", "bar"]' + input: '["foobar", "foobaz", "blarp"]' + output: ['true'] + - program: '. contains ["bazzzzz", "bar"]' + input: '["foobar", "foobaz", "blarp"]' + output: ['false'] + - program: '. contains {foo: 12, bar: [{barp: 12}]}' + input: '{foo: 12, bar:[1,2,{barp:12, blip:13}]}' + output: ['true'] + - program: '. contains {foo: 12, bar: [{barp: 15}]}' + input: '{foo: 12, bar:[1,2,{barp:12, blip:13}]}' + output: ['false'] - title: if-then-else body: | |