Merge pull request #15 from mjhasbach/string_util_pkg.is_str_alpha

Added string_util_pkg.is_str_alpha
This commit is contained in:
mortenbra 2015-05-16 12:28:35 +02:00
commit f2779cae60
2 changed files with 25 additions and 0 deletions

View File

@ -487,6 +487,28 @@ begin
end remove_non_alpha_chars;
function is_str_alpha (p_str in varchar2) return boolean
as
l_returnvalue boolean;
begin
/*
Purpose: returns true if string only contains alpha characters
Who Date Description
------ ---------- -------------------------------------
MJH 12.05.2015 Created
*/
l_returnvalue := regexp_instr(p_str, '[^a-z|A-Z]') = 0;
return l_returnvalue;
end is_str_alpha;
function is_str_alphanumeric (p_str in varchar2) return boolean
as
l_returnvalue boolean;

View File

@ -92,6 +92,9 @@ as
-- remove all non-alpha characters (A-Z) from string
function remove_non_alpha_chars (p_str in varchar2) return varchar2;
-- returns true if string only contains alpha characters
function is_str_alpha (p_str in varchar2) return boolean;
-- returns true if string is alphanumeric
function is_str_alphanumeric (p_str in varchar2) return boolean;