1

Below is my VB.NET code which i required to convert to c#

Dim lsOTHEROPR as string()
lsOTHEROPR(iArrCnt)(1)

Having confusion that how to use the (1) after the array index

3
  • I do not know VB that much but I can suppose that this is a char, so it is like: strArray[index][1] this takes the second char in the string Commented Nov 5, 2018 at 10:37
  • It's probably an index of a char within the string Commented Nov 5, 2018 at 10:38
  • 1
    That's not valid VB6 - there is no string indexer, you must mean VB.Net? Commented Nov 5, 2018 at 10:39

1 Answer 1

3

You can convert it into C# like this:

string[] strArray = new [] { "str", "blah" };
Console.WriteLine(strArray[0][1]); // will return you 't'

That (1) returns the second character in the string that you select from array with lsOTHEROPR(iArrCnt).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.