Dim s As String = "gtdfg123fdgdfs123dd123" Dim c() As Char = {"1", "2", "3"} Dim a() As String = s.Split(c) Dim p As String For Each p In a &nb...[ 查看全文 ]
比如 1223445677777778aabbcccccccccc 经过过滤之后就是12345678abc 代码如下: % '过滤重复 Function norepeat(Str) Dim RegEx If IsNull(Str) Or Str="" Then Exit Function Set RegEx=New RegExp &nb...[ 查看全文 ]
比如 1223445677777778aabbcccccccccc 经过过滤之后就是12345678abc 代码如下: % '过滤重复 Function norepeat(Str) Dim RegEx If IsNull(Str) Or Str="" Then Exit Function Set RegEx=New RegExp RegEx.Global = True RegEx.IgnoreCase=True RegEx.MultiLine = True RegEx.pattern="(.)\1+" str=regEx.replace(str,"$1") Set RegEx=Nothing Norepeat=str End Function '示例 s="12234456...[ 查看全文 ]
答: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...[ 查看全文 ]
'*************测字符串长度************** 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...[ 查看全文 ]