I was wondering is there is a good way of sub stringing parts of a StackTrace string.
Lets say I have a stacktrace showing this:
at TestApplicationInsightLogging.Controllers.TestController.PostEndpoint(TestPostModel input) in c:\users\john\documents\visual studio 2015\Projects\TestApplicationInsightLogging\TestApplicationInsightLogging\Controllers\TestController.cs:line 35
An I want to extract some information from that stack trace, such as:
- Code-Line: "Line: 35"
- Controller: "TestController"
- Method: "PostEdnpoint(TestPostModel input)"
I know I can substring by counting letters ans stuff, but I don't thing that is dynamic enough for different kinds of stacktraces.