From 737aa31546e71e9febea2199582510ef88a2560c Mon Sep 17 00:00:00 2001 From: Alex Cline Date: Mon, 13 May 2013 12:09:33 -0400 Subject: (#20684) Add array comparison functions, difference, intersection and union. Included is code, tests and documentation for the difference, intersection and union functions for comparing arrays. --- README.markdown | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'README.markdown') 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. -- cgit v1.2.3