# Re: 删除太长的字串

Posted by 小贤 on October 22, 1997 at 00:13:50:

In Reply to: Re: 删除太长的字串 posted by 小刘 on October 21, 1997 at 22:08:45:

我写了如下程式, 不知可有更简单写法!
If LenB(StrConv(T, vbFromUnicode)) < T.MaxLength Then Exit Sub
For i = L To Len(T)
If LenB(StrConv(Left(T, i), vbFromUnicode)) <= T.MaxLegth Then L = i
Next i
T = Left(T, l)

字串如果总共有1000 字 , 那 For .... Next 要执行1000次, 不管
我的T.MaxLength 设为多少! 太浪费了..

Follow Ups: