
Returns a boolean indicating whether s ends with sub. For example, "food".startsWith("foo") returns true, whereas "food".startsWith("bar") returns false. Returns a boolean indicating whether s starts with sub. Testing string characteristics startsWith(s, sub) Note: In OpenRefine, using toString() on a null cell outputs the string “null”. For example, value.toString("MMM-dd-yyyy") would convert the date value to “Oct-15-2024”. You can also convert dates to strings, using date parsing syntax built into OpenRefine (see the toDate() function for details). For example, if you applied the expression value.toString("%.0f") to a column: Input You can use toString() to convert numbers to strings with rounding, using an optional string format. Takes any value type (string, number, date, boolean, error, null) and gives a string version of that value. Returns the length of string s as a number. For example, (1 < 3).xor(1 < 7) returns false because more than one of the conditions is true. Evaluates multiple statements, then returns true if only one of them is true. Uses the logical operator XOR (exclusive-or) on two or more booleans to output a boolean. For example, not(1 > 7) returns true because 1 > 7 itself is false. Uses the logical operator NOT on a boolean to output a boolean. For example, (1 7) returns true because at least one of the conditions (the first one) is true. Evaluates multiple statements into booleans, then returns true if all of the statements are true. Uses the logical operator AND on two or more booleans to output a boolean. If you wish to use any regex notation, wrap the pattern in forward slashes. In places where OpenRefine will accept a string (s) or a regex pattern (p), you can supply a string by putting it in quotes. Optional arguments will say “(optional)”. We also use shorthands for substring (“sub”) and separator string (“sep”). If a function can take more than one kind of data as input or can output more than one kind of data, that is indicated with more than one letter (as with “s or a”) or with o for object, meaning it can take any type of data (string, boolean, date, number, etc.). Shorthands are used to indicate the kind of data type used in each function: s for string, b for boolean, n for number, d for date, a for array, p for a regex pattern, and o for object (meaning any data type), as well as “null” and “error” data types. For the reference below, the function is given in full-length notation and the in-text examples are written in dot notation.
