Avatar of vielkacarolina1239
vielkacarolina1239
Flag for United States of America

asked on 

how to create a property for an array member?

Hi,

I am using asp.net 2005

I would like to create a property for an array. I know that for default types I could do something liket this:
public myClass
{
string myStrField

public string myString
{
   set
   {
      myStrField = value
   }
   get
   {
      return myStrField
   }
}

how can I create a property for an array. I tried the following but does not work. how can I fix this code.

public myClass
{
string myStrField

public string myString[inx]
{
   set
   {
      myStrField[inx] = value
   }
   get
   {
      return myStrField[inx]
   }
}

Also, how would I call this property from my code?

thanks,

.NET ProgrammingASP.NET

Avatar of undefined
Last Comment
third

8/22/2022 - Mon