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

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
 
V

verci

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
 
A

Andrew

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
 
G

Guest

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top