'*************测字符串长度************** Function CheckStringLength(txt) txt=trim(txt) x = len(txt) y = 0 for ii = 1 to x if asc(mid(txt,ii,1)) < 0 or asc(mid(txt,ii,1)) 255 then '如果是汉字 y = y + 2 else y = y + 1 end if next CheckStringLength = y End Function '************* 截取字符串 ************** function InterceptString(txt,length) txt=trim(txt) x = len(tx...[ 查看全文 ]
答:import java.util.*; class test { public static void main(String[] args) { String str1="001,002,003,004,006",str2 = "001,002,005"; String str=""; TreeSet ts = new TreeSet(); StringTokenizer st = new StringTokenizer(str1,","); while (st.hasMoreTokens()) { ts.add(st.nextToken()); } st = new StringTokenizer(str2,","); while (st.hasMoreTokens()) { ts.add(st.ne...[ 查看全文 ]
% '************************************************** '函数名:gotTopic '作 用:截字符串,汉字一个算两个字符,英文算一个字符 '参 数:str ----原字符串 ' strlen ----截取长度 '返回值:截取后的字符串 '************************************************** function gotTopic(str,strlen) if str="" then gotTopic="" exit function end if dim l,t,c, i str=replace(replace(replace(replace(str,"...[ 查看全文 ]