The following VB code works correctly and does not flag up any errors.
strLine = strLine.Replace(strLine.LastIndexOf(","), "")
However the same C# code doesn't:
strLine = strLine.Replace(strLine.LastIndexOf(","), "");
This will not compile as it says
The best overloaded method for 'string.Replace(string,string)' has some invalid arguements.
How come this works in VB but not in C#? and how do I fix this?
I thought it might be similar to C# string.Replace doesn't work but it implies that that code will infact complile.
Likewise with other string.Replace questions: string.Replace (or other string modification) not working, it appears they will infact compile, whereas mine will not.
The following VB code removes all the "," seperators- no, it removes all occurences of the textual representation of the position of the last comma in the string of data. E.g., all occurences of"42".