InstrRev (VB) --> C# ???

  • Thread starter Thread starter Andrew
  • Start date Start date
A

Andrew

One year ago I have programmed in VB. There was a function named
"InStrRev".
In C# I don't have found a similar function. Can anybody help me in
this question.

Thanks a lot
regards
andrew
 
Hi Andrew

You must reference the Microsoft.VisualBasic.dll in your project, or copy
the dll to the bin folder, for this function to be map, and use
Microsoft.VisualBasic.Strings.InStrRev.

Regards
 
Hi Verci

Thanks for your fast answer.
So, I was searching a similar function (like Instrrev in VB) in C#.

Two minute ago I have found what I searched.

The function in C# calls lastIndexOf()

Thanks

regards
 
Just be aware that the VB InStrRev is 1-based and LastIndexOf (and all other
..NET methods) are 0-based, so adjust accordingly.
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
Instant Python: C#/VB to Python converter
 
Here's an example of the possible confusion that can occur due to the fact
that the VB function is 1-based:
InStrRev(a, b, c)
converts to the following in C#:
a.LastIndexOf(b, c - 1) + 1
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
Instant Python: C#/VB to Python converter
 
Back
Top