因为Java分类函数在整个UCS-2字符的值域上执行,现在它可以为特别字符进行分类。
下面这个测试程序将试图给一些字母分类:
set serveroutput on size 320000
declare
l_ctype varchar2(256);
begin
for c in 14..127 loop
l_ctype := '';
if ctype.isalnum(chr(c)) then
l_ctype := l_ctype || ',isalnum';
end if;
if ctype.isalpha(chr(c)) then
l_ctype := l_ctype || ',isalpha';
end if;
if ctype.iscntrl(chr(c)) then
l_ctype := l_ctype || ',iscntrl';
end if;
if ctype.isdigit(chr(c)) then
l_ctype := l_ctype || ',isdigit';
end if;
if ctype.isspace(chr(c)) then
l_ctype := l_ctype || ',isspace';
end if;
if ctype.islower(chr(c)) then
l_ctype := l_ctype || ',islower';
end if;
if ctype.isupper(chr(c)) then
l_ctype := l_ctype || ',isupper';
end if;
dbms_output.put_line(''''||chr(c)||''' ('||c||') = '||substr(l_ctype,2));
end loop;
end;
/
show errors;
本文作者:Scott Stephens 为 Oracle工作了13年,他致力于技术支持,电子商务市场和软件开发的工作。
