#统计字符串中每个字符出现的次数 以The quick brown fox jumps over the lazy dog为例 message='The quick brown fox jumps over the lazy dog' count={} for character in message: count.setdefault(character,0) count[character]=count[character]+1 print(count) 参考:<Python编程快速上手--
例子1:统计一个字符串中“,”的个数: select lengthb(regexp_replace('[a,b,c,d,e,f]','[^,]',null)) as res from dual; 例子2:查询lborganization表中字段fdncode包含1个"."号的所有记录:select * from lborganization a where lengthb(regexp_replace('['||a.fdncode||']','[^.]',null)) =1; 例子3