Link to home
Start Free TrialLog in
Avatar of sirbounty
sirbountyFlag for United States of America

asked on

place data in array

What's an easier way to write this (or is there) in .net?

FruitArray(0)="Apple"
FruitArray(1)="Banana"
FruitArray(2)="Cherry"
FruitArray(3)="Grapes"
FruitArray(4)="Melons"
FruitArray(5)="Pineapple"
FruitArray(6)="Strawberry"
Avatar of mazkot
mazkot

Dim FruitArray() As String ={"Apple","Banana","Cherry","Grapes","Melons","Pineapple","Strawberry"}

or

FruitArray() = New String {"Apple","Banana","Cherry","Grapes","Melons","Pineapple","Strawberry"}
Avatar of sirbounty

ASKER

I get
Overload resolution failed because no accessible "New" accepts this number of arguments...
ASKER CERTIFIED SOLUTION
Avatar of tolgaong
tolgaong
Flag of Türkiye 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
SOLUTION
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