Seeing a problem that I can’t explain. Method is returning one thing but it becomes something else.

I have a method that parses a username from a line in a log file. the method returns tuser00058 but it becomes tuser10000. I can not explain why. This works in 9984 cases but fails in only 16.

string User = GetTextFromLogLine(logLine, " for ", 5).TrimEnd('.'); Note I only added the temp variable to verify what it was returning. private string GetTextFromLogLine(string logLine, string start, int startOffset) { int startTime = logLine.IndexOf(start) + startOffset; string temp = logLine.Substring(startTime).Trim(); return temp;//logLine.Substring(startTime).Trim(); } Input [2016-01-14 15:34:51] EXTRA ThreadID:57 StreamingEventListener:==> [StreamingListener::DoSubscribe] Subscribing to notifications for tuser00058@someplace.com. 

I have verified that it returns tuser00058@something.com but when I go back and check the user string it is tuser10000@something.com

Any idea what is going on.

by Mac_Attack18 via /r/csharp

Leave a Reply