Split string is not working in MVC controller

2019-08-06 13:54发布

I have the following code in my MVC controller:

string[] w_result;
string[] w_result2;

string[] new_line = { Environment.NewLine };
string all_copybook = c.original_copybook;

w_result = all_copybook.Split(new_line, StringSplitOptions.RemoveEmptyEntries);
w_result2 = "abaUUUnns s s".Split('a'); 

When I run it in Visual Studio 2012 through the debugger I see no exception, but when I try to view the value of w_result or w_result2, I am getting:

w_result The name 'w_result' does not exist in the current context
w_result2 The name 'w_result2' does not exist in the current context

Any idea why?

1条回答
太酷不给撩
2楼-- · 2019-08-06 14:28

For debugging, change your build configuration to Debug instead of Release. The Release configuration can optimize your code and prevent the debugger from seeing some local variables.

查看更多
登录 后发表回答