The time is too fast. In May March, it will be over again. Say goodbye... We will continue to look forward to the unpredictable April S. Today we will continue to explore.
We may see the most e parameter in catch. There is a StackTrace in it, and it is undeniable that this is too useful. It will call the stack
With it, we can quickly know the execution stream of the running code and quickly locate the problem.
Sometimes we encounter two problems:
①: Online bugs cannot be reproduced locally.
②: Due to too many polymorphism and design patterns, programmers are confused about the flow of online code execution.
To clarify and solve these two problems, we care about the code execution flow and the suspicious variable values in the current context when viewing the Production Log. Obtain suspicious
Variable value. We can record some variable values to log, but how can we record the call stack information of the current statement?
Main( Person person = Fly( Fly( Console.WriteLine(); }
This is not... The file name, method name, and number of rows have all been deprecated, which is a powerful tool for us to see the Production Log.
I don't know how many programmers know this, but there is an overload in it ~
As you can see, I can remove the specified characters before and after the string, as long as I apply for it in char [], rather than just removing spaces. Why do I mention it this time?
Use asp for several days. net, there is a join method in asp, but it is not like the String in C. the Join (",") method can remove the "," at the end, such
Array {1, 2, 3}, after join in asp, it will become "1, 2, 3,", and C # will become "1, 2, 3 ", when asp is passed in, Trim can be used to remove it in C #.
"," At the end.
s = r = s.Trim( [] { Console.Read();
Okay. That's all about it. There's no technical content. The point is to dig it out. It may be useful to you ~