View Full Version : Cosa usate in c# se vi serve un array?
Non mi interessa ottimizzare, mi interessa la comodità:
variabile_my_array.add("ciao");
variabile_my_array.find("ciao");
variabile_my_array[i];
ecc.
ArrayList??? (namespace System.collections)...
ArrayList lst=new ArrayList();
lst.Add("Ciao");
String str=lst.Item[0];
poi c'è BinarySearch e un sacco di altre cose utili...
Originally posted by "soalle"
ArrayList??? (namespace System.collections)...
ArrayList lst=new ArrayList();
lst.Add("Ciao");
String str=lst.Item[0];
poi c'è BinarySearch e un sacco di altre cose utili...
grazie!!!
Non riuscivo a trovare un metodo per accedere ai singoli campi lst.Item[0]
scusa ma a me lst.item[0] non funziona, e nella documentazione item non compare.
Come faccio ad accedere all'i-esimo elemento?
Così il programmino dovrebbe fungere:
using System;
using System.Collections;
class test
{
public static void Main()
{
ArrayList lst=new ArrayList();
lst.Add("Ciao");
String str=(string)lst[0];
Console.WriteLine(str);
}
}
Nota l'accesso all'elemento Ist[0] e il cast a stringa (string)
Originally posted by "atragon"
Così il programmino dovrebbe fungere:
using System;
using System.Collections;
class test
{
public static void Main()
{
ArrayList lst=new ArrayList();
lst.Add("Ciao");
String str=(string)lst[0];
Console.WriteLine(str);
}
}
Nota l'accesso all'elemento Ist[0] e il cast a stringa (string)
Grazie mille!!!
vBulletin® v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.