Merge pull request #12 from mjhasbach/string_util_pkg.is_str_alphanumeric

Added string_util_pkg.is_str_alphanumeric
This commit is contained in:
mortenbra 2015-05-14 00:23:46 +02:00
commit c8d8137c2d
2 changed files with 25 additions and 0 deletions

View File

@ -487,6 +487,28 @@ begin
end remove_non_alpha_chars;
function is_str_alphanumeric (p_str in varchar2) return boolean
as
l_returnvalue boolean;
begin
/*
Purpose: returns true if string is alphanumeric
Who Date Description
------ ---------- -------------------------------------
MJH 12.05.2015 Created
*/
l_returnvalue := regexp_instr(p_str, '[^a-z|A-Z|0-9]') = 0;
return l_returnvalue;
end is_str_alphanumeric;
function is_str_empty (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 is alphanumeric
function is_str_alphanumeric (p_str in varchar2) return boolean;
-- returns true if string is "empty" (contains only whitespace characters)
function is_str_empty (p_str in varchar2) return boolean;