三种java 去掉字符串中的重复字符函数 public static void main(string[] args) { system.out.println(removerepeatedchar("ddddccffgd")); } public static string removerepeatedchar(string s) { if (s == null) return s; stringbuilder sb = new stringbuilder(); , len = s.
常用字符函数介绍 1.ascii 返回与指定的字符对应的十进制数: SQL>select ascii('A') A,ascii('a') a,ascii('0') zero,ascii(' ') space from dual; A A ZERO SPACE ---------- ---------- ---------- ---------- 65 97 48 32 2.chr 给出整数,返回对应的字符:
--字符函数 --伪表dual --(1)求字符串长度 select length('123.456/-*') from dual --(2)截取函数求字符串的子串 ,) from dual --(3)字符串拼接 select concat('ABC','DE') from dual select concat(concat('ABC','DE'),'FG') from dual select 'ABC'||'DE'||'FG' from dual
循环 for循环 while循环 do while循环 通常,入口条件循环比出口条件循环好,因为循环开始前对条件进行检查 c++11基于范围的for循环 对数组(或容器类,如:vector和array)的每个元素执行相同操作 int a[5]={1,3,4,5,6}: for (int i :a) cout<<i<<endl; //////不断循环把依次打印出来 int a[5]={1,3,4,5,6}: