DROP Function

── DROP ── ( ──<string expression>── , ──<arithmetic expression>── ) ──┤

The DROP function returns a string with a value equal to the value of the string expression with the first arithmetic expression characters deleted. The value of the arithmetic expression is rounded to an integer, if necessary. An error occurs if the rounded value of the arithmetic expression is greater than the number of characters in the string expression or less than 0 (zero). If the rounded value of the arithmetic expression is 0, the result is the same as the value of the string expression. If the rounded value of the arithmetic expression is equal to the length of the string expression, the result is the null string.

The DROP function and the TAKE function are complementary functions. This means that for any string expression S and any arithmetic expression A in the range 0 <= A <= LENGTH(S), the following relation is always TRUE:

S = TAKE(S,A) CAT DROP(S,A)

For more information, see TAKE Function.

Examples of the DROP Function

In the following examples, string S has a length of 6 and contains 8"ABCDEF".

DROP(S,2) = 8"CDEF"

DROP(TAKE(S,4),2) = 8"CD"

DROP(S,6) = the null string