Core (dw::Core) | MuleSoft Documentation
# Core (dw::Core)
This module contains core DataWeave functions for data transformations. It is automatically imported into any DataWeave script.
## Functions
Name | Description  
---|---  
Concatenates two values.  
Removes specified values from an input value.  
Returns the absolute value of a number.  
Returns the average of numbers listed in an array.  
Rounds a number up to the nearest whole number.  
Returns `true` if an input contains a given value, `false` if not.  
Returns the number of days between two dates.  
Iterates over the input and returns the unique elements in it.  
Returns `true` if a string ends with a provided substring, `false` if not.  
Returns an array of key-value pairs that describe the key, value, and any attributes in the input object.  
evaluateCompatibilityFlag | Returns the value of the compatibility flag with the specified name.  
Iterates over an array and applies an expression that returns matching values.  
| Iterates a list of key-value pairs in an object and applies an expression that returns only matching objects, filtering out the rest from the output.  
Returns indices of an input that match a specified value.  
Iterates over each item in an array and flattens the results.  
Turns a set of subarrays (such as `[ [1,2,3], [4,5,[6]], [], [null] ]`) into a single, flattened array (such as `[ 1, 2, 3, 4, 5, [6], null ]`).  
Rounds a number down to the nearest whole number.  
Returns an object that groups items from an array based on specified criteria, such as an expression or matching selector.  
Returns the index of the _first_ occurrence of the specified element in this array, or `-1` if this list does not contain the element.  
Returns `true` if the given string is empty (`""`), completely composed of whitespaces, or `null`. Otherwise, the function returns `false`.  
Returns `true` if the given number contains a decimal, `false` if not.  
Returns `true` if the given input value is empty, `false` if not.  
Returns `true` if the number or numeric result of a mathematical operation is even, `false` if not.  
Returns `true` if the given number is an integer (which lacks decimals), `false` if not.  
Returns `true` if it receives a date for a leap year, `false` if not.  
Returns `true` if the number or numeric result of a mathematical operation is odd, `false` if not.  
Merges an array into a single string value and uses the provided string as a separator between each item in the list.  
Returns an array of keys from key-value pairs within the input object.  
Returns the index of the _last_ occurrence of the specified element in a given array or `-1` if the array does not contain the element.  
Without changing the value of the input, `log` returns the input as a system log. So this makes it very simple to debug your code, because any expression or subexpression can be wrapped with **log** and the result will be printed out without modifying the result of the expression. The output is going to be printed in application/dw format.  
Returns the provided string in lowercase characters.  
Iterates over items in an array and outputs the results into a new array.  
Iterates over an object using a mapper that acts on keys, values, or indices of that object.  
Uses a Java regular expression (regex) to match a string and then separates it into capture groups. Returns the results in an array.  
Checks if an expression matches the entire input string.  
Returns the highest `Comparable` value in an array.  
Iterates over an array and returns the highest value of `Comparable` elements from it.  
Returns the lowest `Comparable` value in an array.  
Iterates over an array to return the lowest value of comparable elements from it.  
Returns the modulo (the remainder after dividing the `dividend` by the `divisor`).  
Returns an array of strings with the names of all the keys within the given object.  
Returns a `DateTime` value for the current date and time.  
Executes a callback function if the preceding expression returns a `null` value and then replaces the `null` value with the result of the callback.  
Reorders the elements of an input using criteria that acts on selected elements of that input.  
Useful for mapping an object into an array, `pluck` iterates over an object and returns an array of keys, values, or indices from the object.  
Raises the value of a `base` number to the specified `power`.  
Returns a pseudo-random number greater than or equal to `0.0` and less than `1.0`.  
Returns a pseudo-random whole number from `0` to the specified number (exclusive).  
Reads a string or binary and returns parsed content.  
Reads a URL, including a classpath-based URL, and returns parsed content. This function works similar to the `read` function.  
Applies a reduction expression to the elements in an array.  
Performs string replacement.  
Rounds a number up or down to the nearest whole number.  
Returns an array with all of the matches found in an input string.  
Returns the number of elements in an array. It returns `0` if the array is empty.  
Splits a string into a string array based on a value that matches part of that string. It filters out the matching part from the returned array.  
Returns the square root of a number.  
Returns `true` or `false` depending on whether the input string starts with a matching prefix.  
Returns the sum of numeric values in an array.  
This function works as a pipe that passes the value returned from the preceding expression to the next (a callback) only if the value returned by the preceding expression is not `null`.  
Returns a range with the specified boundaries.  
Removes any blank spaces from the beginning and end of a string.  
Returns the primitive data type of a value, such as `String`.  
Performs the opposite of `zip`. It takes an array of arrays as input.  
Returns the provided string in uppercase characters.  
Returns a v4 UUID using random numbers as the source.  
Returns an array of the values from key-value pairs in an object.  
Helper function that specifies a replacement element. This function is used with `replace`, `update` or `mask` to perform data substitutions.  
Writes a value as a string or binary in a supported format.  
Creates a `xsi:type` type attribute. This method returns an object, so it must be used with dynamic attributes.  
Merges elements from two arrays into an array of arrays.  
## Types
## Namespaces
  * 

## Annotations
  *