Link to home
Start Free TrialLog in
Avatar of datamobility
datamobility

asked on

How to declare an indexer in VB.NET

In C# I can do this:

public string this[int idx]
{
  get { return (string) lookupItem(idx); }
}

How can I do that in VB?  

Cheers,
.pd.
Avatar of RonaldBiemans
RonaldBiemans

you this ?

dim mystring as string =" test"

public function charstring(mystring as as string,index as integer) as char
   return mystring.chars(index)
end function

or just

dim mychar as char = mystring.chars(3)
you this

should ofcourse be

you mean this ?

:-)
ASKER CERTIFIED SOLUTION
Avatar of wyoung76
wyoung76
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of datamobility

ASKER

And tonight's winner of the "correct end of the stick" award goes to.....


Thanks!

.pd.