我想知道如何搜索两个字符串,选择它们之间的所有内容,然后将其复制到剪贴板。
Dim str As String
str = strcode
If str.Contains(".m3u8") = True Then
MsgBox("The string Contains() '.M3U8' ")
Else
MsgBox("The String does not Contains() '.M3U8'")
End If
答案 0 :(得分:1)
这可能会有一些帮助,我还链接到下面的一个更详细的说明。
sub Container()
If str.Contains(".m3u8") = True Then
'Copy the information to the clipboard
Clipboard.SetText(strcode)
End If
End Sub
http://www.brangle.com/wordpress/2009/08/how-to-cutcopypaste-text-into-clipboard-using-vb-net/
答案 1 :(得分:0)
使用此功能:
Function FindText(ByVal source As String, ByVal start As String, ByVal stop As String)
Dim startIndex As Integer = source.IndexOf(start)
If startIndex = -1 Then Throw New ArgumentException("start value not found in string")
startIndex += start.Length
Dim stopIndex As Integer = source.IndexOf(stop, startIndex)
If stopIndex = -1 Then Throw New ArgumentException("stop value not found in string")
Return source.SubString(startIndex, stopIndex - startIndex)
End Function
并在结果上调用ClipBoard.SetText()
。