以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  有没有办法批量replace?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=158023)

--  作者:石四
--  发布时间:2020/11/5 11:17:00
--  有没有办法批量replace?
Excel表“成员”列,多值字段比如:张三(zhs),李四(lis),王五(waw),导入FOXTABLE需要去年括号及里面的值,变成:张三,李四,王五
  Dim s As String = sheet(n, i).Text
                     s.Replace("(*)","")
去不掉,怎么办?



--  作者:石四
--  发布时间:2020/11/5 11:19:00
--  
EXCEL表里用查找(*),替换 “”,能去掉。


--  作者:有点蓝
--  发布时间:2020/11/5 11:37:00
--  
Dim pattern As String = "\\(\\w+(?=\\))\\)"
Dim txt = "张三(zhs),李四(lis),王五(waw)"
Dim str = System.Text.RegularExpressions.Regex.Replace(txt , pattern ,"")
Output.Show(str)

--  作者:石四
--  发布时间:2020/11/5 11:46:00
--  
Dim pattern As String = "\\(\\w+(?=\\))\\)"
Dim txt = "ABC(111), DEF(234)"
Dim str = System.Text.RegularExpressions.Regex.Replace(txt , pattern ,"")
Output.Show(str)
str = str.replace(", ",",")
Output.Show(str)
这个分两步删除逗号后空格,一步能完成吗?

--  作者:有点蓝
--  发布时间:2020/11/5 11:48:00
--  
Dim pattern As String = "\\(\\w+(?=\\))\\)| "
--  作者:石四
--  发布时间:2020/11/5 11:53:00
--  
OK!Thanks