summaryrefslogtreecommitdiff
path: root/README.markdown
diff options
context:
space:
mode:
authorHailee Kenney <hailee@puppetlabs.com>2013-05-15 13:56:15 -0700
committerHailee Kenney <hailee@puppetlabs.com>2013-05-15 13:56:15 -0700
commita2abfb9894e8b91eeeffea0faa5d6e55a0519667 (patch)
treee13852080cd3a6f8aaae722ab13d2ae252802898 /README.markdown
parentdad3a2948fb9ebc5c45975340bc8796c9c041d9a (diff)
parent737aa31546e71e9febea2199582510ef88a2560c (diff)
Merge pull request #155 from AlexCline/feature/master/array_comparison_functions
(#20684) Add array comparison functions, difference, intersection and union
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown33
1 files changed, 33 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown
index 7b45b17..8d07a82 100644
--- a/README.markdown
+++ b/README.markdown
@@ -195,6 +195,18 @@ Would return: ['a','c']
- *Type*: rvalue
+difference
+----------
+This function returns the difference between two arrays.
+The returned array is a copy of the original array, removing any items that
+also appear in the second array.
+
+*Examples:*
+
+ difference(["a","b","c"],["b","c","d"])
+
+Would return: ["a"]
+
dirname
-------
Returns the `dirname` of a path.
@@ -416,6 +428,16 @@ Would return: {'a'=>1,'b'=>2,'c'=>3}
- *Type*: rvalue
+intersection
+-----------
+This function returns an array an intersection of two.
+
+*Examples:*
+
+ intersection(["a","b","c"],["b","c","d"])
+
+Would return: ["b","c"]
+
is_array
--------
Returns true if the variable passed to this function is an array.
@@ -868,6 +890,17 @@ Returns the type when passed a variable. Type can be one of:
- *Type*: rvalue
+union
+-----
+This function returns a union of two arrays.
+
+*Examples:*
+
+ union(["a","b","c"],["b","c","d"])
+
+Would return: ["a","b","c","d"]
+
+
unique
------
This function will remove duplicates from strings and arrays.