正 文

利用Java来模仿字符类型识别


www.7dspace.com  更新日期:2006-1-28 8:00:35  七度空间


因为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年,他致力于技术支持,电子商务市场和软件开发的工作。

3页,页码:[1] [2] [3] 

上一篇:创建接受可变数目参数的方法
下一篇:使用JNLP部署应用程序
标题:利用Java来模仿字符类型识别 作者:Scott Stephens 来源:开发者在线
收藏此页】【打印】【关闭
站 内 搜 索
 

热 点 导 读
特 别 推 荐