Mohan
Mohan

Reputation: 41

VB.NET to C# string array conversion

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

Upvotes: 1

Views: 321

Answers (1)

Markiian Benovskyi
Markiian Benovskyi

Reputation: 2161

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).

Upvotes: 3

Related Questions