c# - Debugging through an extension method -


I have created a method in C # that spreads the strat datatype, making the split function an additional overload so that the text qualifier The string data can be defined as "field 1", "field2", "filed3"

  string [] splitData = data.Split (' , '', '' '')   

The extension works fine. Once I can use the method after using context and namespace. Although there is an issue in the method that I am trying to debug, but the debugger will not take action in the extension method.

Extension code

  namespace extensions {public static class string extension {public static string [] split (this string s, four delimiter, four qualifiers ) {// method works}}}   

code in NIIT test

  string testString = "\" field 1 \ ", \" field2 \ ", \" field3 \ "" integer expected count = 3; // test string [] results = testString.Split (',', '' '); reciprocated (expected count, result; length); I do not move into testString.Split (', ',' '') It gives a result and shows the intellisense extension method.The debugger is only the step above it, because it will be created in split mode.  

Any ideas ??

Basically, when you call testString.Split (',', '' '') , Then is actually called a pub Lick string [] Split (Parameters four [] separator) Overload is not your extension method, that is because members of the example, if applicable, prefer to always expansion methods.

Only two things that you can either change the name of your method or somehow can change the signature, so it is different because different string.plit overload. < / P>

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

c# - Confused over DLL entry points (entry point not found exception) -