我想知道是否有更好的方法来编写这些多个If语句?我确定有,我只是想不出它是什么.本质上,代码只是缩短了字符串.
If text = "-----------------" Then
text = "-"
End If
If text = "----------------" Then
text = "-"
End If
If text = "---------------" Then
text = "-"
End If
If text = "--------------" Then
text = "-"
End If
If text = "-------------" Then
text = "-"
End If
If text = "------------" Then
text = "-"
End If
If text = "-----------" Then
text = "-"
End If
If text = "----------" Then
text = "-"
End …Run Code Online (Sandbox Code Playgroud)