I am using the Fiddler web debugger which uses FiddlerScript which is based on JScript.NET. I'm trying to do some simple .NET string parsing but it fails with error "More than one method or property matches this argument list". For example:
var ahraw: String = "one, two, three, four";
var ah: Array = ahraw.Split([',', ' '], System.StringSplitOptions.RemoveEmptyEntries);
for (var i in ah) {
FiddlerObject.alert("\"" + ah[i] + "\"");
}
String.Split has these prototypes:
Split(Char[], Int32, StringSplitOptions)
Split(String[], Int32, StringSplitOptions)
Split(String[], StringSplitOptions)
Split(Char[], StringSplitOptions)
Split(Char[], Int32)
Split(Char[])
Even if I add an Int32 and run it like ahraw.Split([',', ' '], 99, System.StringSplitOptions.RemoveEmptyEntries);
or ahraw.Split(", ", 99, System.StringSplitOptions.RemoveEmptyEntries);
it still finds multiple methods. Is it possible to force the specific .NET type? Something like var sep: String
doesn't work either.
Of course there are other ways to split a string in JScript such as split() (note the lowercase s). I'm more interested in how I can get around this issue for when there's no javascript equivalent for the function I need to call, so I have to call a .NET funciton.