25.17 SPLIT Function Signature 1

Use this function to split input string at separator.

Syntax

split (
    p_str   in varchar2,
    p_sep   in varchar2 default wwv_flow.LF,
    p_limit in pls_integer default null )
    return wwv_flow_t_varchar2;

Parameters

Table 25-19 SPLIT Function Signature 1 Parameters

Parameters Description

p_str

The input string.

p_sep

The separator. If null, split after each character. If a single character, split at this character. If more than 1 character, split at regular expression. The default is to split at line feed.

p_limit

Maximum number of splits, ignored if null. If smaller than the total possible number of splits, the last table element contains the rest.

Examples

apex_string.split(1||chr(10)||2||chr(10)||3)
-> apex_t_varchar2('1','2','3')

apex_string.split('1:2:3',':')
-> apex_t_varchar2('1','2','3')

apex_string.split('123',null)
-> apex_t_varchar2('1','2','3')

apex_string.split('1:2:3:4',':',2)
-> apex_t_varchar2('1','2:3:4')

apex_string.split('key1=val1, key2=val2','\s*[=,]\s*')
-> apex_t_varchar2('key1','val1','key2','val2')