Use \\t
instead of \t
. The \t
is seen as a tab-character. sDocType = pqReq.Substring(0, pqReq.IndexOf(@"\t"));
Edit:
I didn't notice the \t
being literal due to the @
. But is your input string a literal string? If not, place an @
before the value of pqReq
.
string pqReq = @"CSTrlsEN\t001\t\\sgprt\Projects2\t001\tCSTrl";
int i = pqReq.IndexOf(@"\t");
//i = 8