以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  如何去除表格所有单元格里的回车和换行?空格等符号  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=110016)

--  作者:fuucc
--  发布时间:2017/11/24 14:22:00
--  如何去除表格所有单元格里的回车和换行?空格等符号
如何去除表格所有单元格里的回车和换行?空格等符号。
--  作者:有点甜
--  发布时间:2017/11/24 15:33:00
--  
Dim chars() As String = {chr(10), chr(13), " "}
Dim dt As DataTable = DataTables("表A")
For Each dr As DataRow In dt.datarows
    For Each dc As DataCol In dt.DataCols
        If dc.Expression = "" Then
            Dim str As String = dr(dc.name)
            For Each s As String In chars
                str = str.replace(s, "")
            Next
            dr(dc.name) = str
        End If
    Next
Next