去除(即删除)特殊字符
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了去除(即删除)特殊字符相关的知识,希望对你有一定的参考价值。
/* Strip(remove) special character(s) from a string. Parameters -1-: String to process -2-: Special character to strip Note: If second parameter is null then the following list is used: <tab>, <single quote>, <double quote>, <>, <|>, <`>, <~>, <^> */ FUNCTION strip_spc_character ( in_string IN varchar2, in_chars IN varchar2 DEFAULT NULL ) RETURN varchar2 IS tab CHAR( 1 ) := chr(9); double_quote CHAR( 1 ) := chr(34); single_quote CHAR( 1 ) := chr(39); mask varchar2( 80 ) := '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; v_special_chars varchar2( 80 ) := '`~^|'||double_quote||single_quote||tab; BEGIN IF in_chars IS NOT NULL THEN v_special_chars := in_chars; END IF; RETURN translate( in_string, mask || v_special_chars, mask ); exception WHEN others THEN RETURN in_string; END strip_spc_character;
以上是关于去除(即删除)特殊字符的主要内容,如果未能解决你的问题,请参考以下文章