25.2 GET_INITIALS Function

Get N letter initials from the first N words.

Syntax

get_initials (
   p_str in varchar2,
   p_cnt in number default 2 )
   return varchar2

Parameters

Table 25-2 GET_INITIALS Function Parameters

Parameters Description

p_string

The input string.

p_cnt

The N letter initials to get from the first N words. The default is 2.

Example

Get initials from "John Doe".

begin
  sys.dbms_output.put_line(get_initials('John Doe'));   
end; 
-> JD

begin
  sys.dbms_output.put_line(apex_string.get_initials(p_str => 'Andres Homero Lozano Garza', p_cnt => 3));
end;
-> AHL