您的位置:程序门 -> vb ->



字符串分割字母aa和数字123456


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


字符串分割字母aa和数字123456[无满意答案结贴,结贴人:ningyong58]
发表于:2007-10-27 20:58:57 楼主
以下程序
        dim   i   as   integer
        dim   a   as   double
        text1   =   "abc1234.56bcd"
        for   i   =   1   to   len(text1)
                text2   =   mid(text1,   i,   len(text1)   -   i   +   1)
                if   text2   <   48   and   text2   >   65   then
                        exit   for
                end   if
        next
        debug.print   text2
返回1234.56

我的要求是
  将字符串   cbl0.6,   分离为字符串cbl和数字0.6
                                              字符串bl   和数字25
以上程序如何改。
发表于:2007-10-27 21:37:411楼 得分:0
vb.net code
dim s$, s1$, s2$, i%, temp$ s = "cbl0.6" for i = 1 to len(s) temp = mid(s, i, 1) if asc(temp) > 47 and asc(temp) < 58 then exit for next s1 = left$(s, i - 1) s2 = right$(s, len(s) - (i - 1)) debug.print s1, s2
发表于:2007-10-28 17:13:332楼 得分:0
mark


快速检索

最新资讯
热门点击