在字符串中,我有类似“First & vbCrLf & Name”的内容 - 但是,我想取出 & vbCrLf &,这样它就不会导致换行。
我做过类似的事情
If theString.Contains("& vbCrLf &") Then
' and replace, could do this above of course, but I just want it to go into the IF
End If
Run Code Online (Sandbox Code Playgroud)
和
If theString.Contains("\n") Then
' and replace, could do this above of course, but I just want it to go into the IF
End If
Run Code Online (Sandbox Code Playgroud)
甚至"\r\n"但无济于事。
我缺少什么?
If theString.Contains(vbCrLf) Then
'Do something
End If
Run Code Online (Sandbox Code Playgroud)
或者...
theString = theString.Replace(vbCrLf, "")
Run Code Online (Sandbox Code Playgroud)