1. IndexOf's 'start' parameter is 0-based, while InStr is 1-based.
2. If you're converting existing code, then you'll also have to add 1 to the
result since InStr's result is 1-based while IndexOf's result is 0-based.
So, unless you're rewriting the surrounding code (instead of just converting
it), the correct translation is:
i = sDocName.IndexOf("\"", 0) + 1;
David Anton
www.tangiblesoftwaresolutions.com
Home of the Instant C# VB.NET to C# converter
and the Instant VB C# to VB.NET converter
"cloudx" wrote:
hi there, how do I translate the following vb code to C#? I know to use
Indexof, but what would be for """"? Thanks!
InStr(1, sDocName, """")