50.11 GET_SLUG Function

Use this function to convert the input string to a "-" separated string, with special characters removed. The returned string contains a maximum of 255 characters in total, including hash (if requested).

Syntax

FUNCTION GET_SLUG (
    p_string               IN VARCHAR2,
    p_hash_length          IN PLS_INTEGER DEFAULT 0 )
RETURN VARCHAR2;

Parameters

Table 50-8 GET_SLUG Function Parameters

Parameter Description
p_string The input string.
p_hash_length If > 0 (default is 0), append random digits to make the result unique. The longest hash that may be returned is 38 digits.

Example

select apex_string_util.get_slug('hey now, brown cow! 1') from dual; 
-> hey-now-brown-cow-1
--
select apex_string_util.get_slug('hey now, brown cow! 1',4) from dual;
-> hey-now-brown-cow-1-3486