String parse error

Results 1 to 2 of 2

Thread: String parse error

  1. #1
    Join Date
    Dec 1969

    Default String parse error

    I&#039;m trying to find the first occurance of the "\" character. I&#039;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>

  2. #2
    Join Date
    Dec 1969

    Default RE: String parse error

    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...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts