ADF Collection Functions学习
1、contains(用于判断字符串是否包含子字符串)
Returns true if dictionary contains a key, list contains value, or string contains substring. For example, the following expression returns true: contains(‘abacaba’,‘aca’)">Returns true if dictionary contains a key, list contains value, or string contains substring. For example, the following expression returns true: contains(‘abacaba’,‘aca’)
2、empty(判断对象,数组、字符串是否为空)
Returns true if object, array, or string is empty. For example, the following expression returns true: empty(’’)
3、first(返回传入的数组或字符串的第一个元素)
Returns the first element in the array or string passed in. For example, this function returns 0: first([0,2,3])
4、intersection(返回单个数组或对象取交集)
Returns a single array or object with the common elements between the arrays or objects passed to it. For example, this function returns [1, 2]: intersection([1, 2, 3], [101, 2, 1, 10],[6, 8, 1, 2]). The parameters for the function can either be a set of objects or a set of arrays (not a mixture thereof). If there are two objects with the same name, the last object with that name appears in the final object.
5、join(返回一个字符串,该字符串包含数组中的所有项)
Return a string that has all the items from an array and has each character separated by a delimiter.
6、last(返回传入的数组或字符串的最后一个元素)
Returns the last element in the array or string passed in. For example, this function returns 3: last([0,2,3])
7、length(返回数组或字符串中的元素数)
Returns the number of elements in an array or string. For example, the following expression returns 3: length(‘abc’)
8、skip(返回数组中从索引开始的元素,包括索引位置)
Returns the elements in the array starting at index Count, for example this function returns [3, 4]: skip([1, 2 ,3 ,4], 2)
9、take(返回数组中索引位置之前的元素,不包括索引位置的元素)
Returns the first Count elements from the array or string passed in, for example this function returns [1, 2]: take([1, 2, 3, 4], 2)
10、union(返回单个数组或对象取并集,相同对象只取一个)
Returns a single array or object with all of the elements that are in either array or object passed to it. For example, this function returns [1, 2, 3, 10, 101] : union([1, 2, 3], [101, 2, 1, 10]). The parameters for the function can either be a set of objects or a set of arrays (not a mixture thereof). If there are two objects with the same name in the final output, the last object with that name appears in the final object.