Zalek Bloom
Zalek Bloom

Reputation: 551

Split string is not working in MVC controller

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?

Upvotes: 1

Views: 1517

Answers (1)

fcuesta
fcuesta

Reputation: 4520

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.

Upvotes: 1

Related Questions