Option Strict Off
Imports System
Public Class Test
Public Shared Sub Main()
Dim x As String = "abcdef"
Dim y As String = "d"
For Each z As String In MySplit(x, y)
Console.WriteLine(z)
Next
End Sub
Shared Function MySplit(ByVal str As String, ByVal ParamArray separator As Char()) As String()
Console.WriteLine("Char")
Return str.Split(separator)
End Function
Shared Function MySplit(ByVal str As String, ByVal ParamArray separator As String()) As String()
Console.WriteLine("String")
Return str.Split(separator, StringSplitOptions.None)
End Function
End Class
T3B0aW9uIFN0cmljdCBPZmYKSW1wb3J0cyBTeXN0ZW0KClB1YmxpYyBDbGFzcyBUZXN0CiAgICBQdWJsaWMgU2hhcmVkIFN1YiBNYWluKCkKICAgIAlEaW0geCBBcyBTdHJpbmcgPSAiYWJjZGVmIgogICAgICAgIERpbSB5IEFzIFN0cmluZyA9ICJkIgogICAgICAgIEZvciBFYWNoIHogQXMgU3RyaW5nIEluIE15U3BsaXQoeCwgeSkKICAgICAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUoeikKICAgICAgICBOZXh0CiAgICBFbmQgU3ViCiAgICBTaGFyZWQgRnVuY3Rpb24gTXlTcGxpdChCeVZhbCBzdHIgQXMgU3RyaW5nLCBCeVZhbCBQYXJhbUFycmF5IHNlcGFyYXRvciBBcyBDaGFyKCkpIEFzIFN0cmluZygpCiAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUoIkNoYXIiKQogICAgICAgIFJldHVybiBzdHIuU3BsaXQoc2VwYXJhdG9yKQogICAgRW5kIEZ1bmN0aW9uCiAgICBTaGFyZWQgRnVuY3Rpb24gTXlTcGxpdChCeVZhbCBzdHIgQXMgU3RyaW5nLCBCeVZhbCBQYXJhbUFycmF5IHNlcGFyYXRvciBBcyBTdHJpbmcoKSkgQXMgU3RyaW5nKCkKICAgICAgICBDb25zb2xlLldyaXRlTGluZSgiU3RyaW5nIikKICAgICAgICBSZXR1cm4gc3RyLlNwbGl0KHNlcGFyYXRvciwgU3RyaW5nU3BsaXRPcHRpb25zLk5vbmUpCiAgICBFbmQgRnVuY3Rpb24KRW5kIENsYXNzCg==