Gombsogattest
New Member
I'm trying to find the first occurance of the "\" character. I'm getting 0 for lIndexNumber for DOMAINNAMEUSERNAME instead of 11. Any ideas?<BR><BR>string lAuthUser = Request.ServerVariables["AUTH_USER"]; <BR>int lIndexNumber = lAuthUser.IndexOf("\"");<BR>lAuthUser = lAuthUser.Remove(0, lIndexNumber);<BR>This is because the backslash is the escape character for C#. To specify that you literally want to search for a backslash character, use TWO CONSECUTIVE backslash characters, like: \<BR><BR>So, do:<BR><BR>int iIndexNumber = lAuthUser.IndexOf("\");<BR><BR>hth...