求助!遍历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编辑过]