regex.Pattern = "(.*?),$"
考试文字:
Lorem ipsum,lorem,ipsum,lorem,
我想要(真实)
Lorem ipsum,lorem,ipsum,lorem
要删除的最后一个字符,
(逗号)
我正在使用经典ASP。
kelime = "Lorem ipsum,lorem,ipsum,lorem,"
Dim regex
Set regex = New RegExp
regex.IgnoreCase = True
regex.Pattern = "(.*?),$"
Set colMatches = regex.Execute(kelime)
If colMatches.Count > 0 Then
strTitle = colMatches(0).Value
'strTitle.Remove(strTitle.Length - 1)
Else
strTitle = ""
End If
response.write strTitle
答案 0 :(得分:0)
kelime =左(kelime,LEN(kelime)-1)