Why am I getting this error because of this code:
str is a stringCode:int intStart = str.LastIndexOf("\");
Printable View
Why am I getting this error because of this code:
str is a stringCode:int intStart = str.LastIndexOf("\");
int intStart = str.LastIndexOf(@"\");
or
int intStart = str.LastIndexOf("\\");
the reason is because \ is a special character in c#
so either you use \\ to tell the compiler that ur looking for that character, or you use @ sign to make the text between quotation a string.
Thanks, a search on google turned up nothing but I did figure it out, lol. Guess I should have updated my post.