标题:求助!遍历txt里的字符,只保留数字、字母、和汉字,删除其他字符(如回车, ...
取消只看楼主
q173641439
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2018-6-5
结帖率:100%
已结贴  问题点数:20 回复次数:0 
求助!遍历txt里的字符,只保留数字、字母、和汉字,删除其他字符(如回车,空格等)
程序代码:
'Kp输出
Public Sub passive_Kp_output(error_happen As Boolean, bottom_layer As Integer, layers_number As Integer, H() As Double, Kp() As Double, soil_name() As String)
If layers_number = 0 Then
    Exit Sub
Else

 Form1.Text1.Text = Form1.Text1.Text & vbCrLf & "1.2各土层Kp值" & vbCrLf
    For i = 1 To layers_number - bottom_layer + 1 Step 1
        If i = 1 Then
            For j = 1 To bottom_layer Step 1
                temp = temp + H(j)
            Next j
            first_in_layers_thickness = temp - L '第一层坑内土表面到该层层底的实际厚度
            Form1.Text1.Text = Form1.Text1.Text & "" & i & "层(" & first_in_layers_thickness & "m" & soil_name(i + bottom_layer - 1) & "):" & "  "
            Form1.Text1.Text = Form1.Text1.Text & "Kp_" & i & "=" & Format(Kp(i), "0.000") & vbCrLf
        Else
            Form1.Text1.Text = Form1.Text1.Text & "" & i & "层(" & H(i + bottom_layer - 1) & "m" & soil_name(i + bottom_layer - 1) & "):" & "  "
            Form1.Text1.Text = Form1.Text1.Text & "Kp_" & i & "=" & Format(Kp(i), "0.000") & vbCrLf
        End If
    Next i
End If
End Sub
   可以看到并没有换行操作,,为什么还是有换行呢

[此贴子已经被作者于2018-6-5 11:04编辑过]

搜索更多相关主题的帖子: 字符 If Text Text1 temp 
2018-06-05 11:00



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-487621-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.350880 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved