使用或不使用正则表达式,是否有更短的写入方式?
Dim q1 = System.Text.RegularExpressions.Regex.Match(myString,
"[\n\r]finished", System.Text.RegularExpressions.RegexOptions.IgnoreCase)
If (q1.Success) Then Exit Sub
答案 0 :(得分:2)
是:
Imports System.Text.RegularExpressions
If (Regex.IsMatch(SubjectString, "(?i)\nfinished")) Then Exit Sub
(检查\n
应该足够了,除非您还定位仅使用\r
替换新行的旧Mac(OS X前)文件)