以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- StringBuilder删除后面的字符串问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=173636) |
-- 作者:as2565929355 -- 发布时间:2021/12/9 10:50:00 -- StringBuilder删除后面的字符串问题 后面的UNION 不知道要怎么样删除 Dim MergeStr As new StringBuilder Dim MergeCell As String For i As Integer = 0 To 10000 MergeStr.AppendLine( "se le ct " & i & " UN IO N ") Next Dim v As String v = mergestr.ToString()\'将合并好的字符串转换成单个的字符串 If v.EndsWith(Chr(10)) V = V.TrimE nd(Chr(10)) v = v.TrimEnd(" ") v = v.TrimEnd("N") End If Output.Show(v) 显示结果是:sel ec t 9696 UNION se lect 9697 UN IO N se lec t 9698 U NIO N se lect 9699 UN ION |
-- 作者:有点蓝 -- 发布时间:2021/12/9 10:57:00 -- Dim v As String v = mergestr.ToString() v = v.substring(0,v.length - 6) msgbox(v)
|