以文本方式查看主题
- Foxtable(狐表) (http://foxtable.net/bbs/index.asp)
-- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2)
---- 如何遍历行,将123456789行的值组合成组合成类似1,2,3,4,5,6,7,8,9,0 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=174667)
|
-- 作者:cnsjroom
-- 发布时间:2022/1/25 19:53:00
-- 如何遍历行,将123456789行的值组合成组合成类似1,2,3,4,5,6,7,8,9,0
如何遍历行,然后组合值
当前是根据干警信息表中的电话来组合成s这个值,想实现多个电话组合成类似1,2,3,4,5,6,7,8,9,0
Dim t1 As Table=Tables("测试_table2") Dim t2 As Table=Tables("云mas告知内容") Dim Products As List(Of String) = DataTables("干警信息").GetValues("电话") Dim ba As New Jarray Dim s As String Dim sysss As List(Of String()) = DataTables("sys").GetValues("ecName|apid|sign|addserial|secretKey") Dim t11 As WinForm.TextBox = e.Form.Controls("TextBox1") For i As Integer = 0 To Products.Count - 1 ba.Add(Products(i)) output.show(Products(i)) t2.addnew t2.Current("mobiles")=Products(i) If ba.Count = 3 OrElse i = Products.Count - 1 Then \'output.show(Products(i)) output.show(ba.ToString()) s=ba.ToString() s=s.Replace("""","") s=s.Replace("[","") s=s.Replace("]","") s=s.Replace("\\r","") s=s.Replace("\\n","") s=s.Replace(" ","") s=s.TrimStart s=s.TrimEnd output.show(s) ba = New Jarray t1.addnew t1.Current("mobiles")=s For Each syss As String() In sysss t1.Current("ecName")=syss(0) t1.Current("apid")=syss(1) t1.Current("sign")=syss(2) t1.Current("addserial")=syss(3) t1.Current("secretKey")=syss(4) t1.Current("content")=t11.text Next End If Next
得到的s是如下格式:
1234567890,
3124556666,
4234124111,
有没有办法直接成为
1234567890,3124556666,4234124111, 且末尾一个, 去掉
[此贴子已经被作者于2022/1/25 20:27:24编辑过]
|