|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
split a string into an arraylist?If I try splitting a string into an arraylist
Dim arrList As New ArrayList arrList = Split("a,b,c", ",") I get this error: Value of type '1-dimensional array of String' cannot be converted to 'System.Collections.ArrayList'. How can I split a string into an arraylist? Thanks "Mad Scientist Jr" <usenet_daugh***@yahoo.com> schrieb arrlist.addrange(Split("a,b,c", ","))> If I try splitting a string into an arraylist > > Dim arrList As New ArrayList > arrList = Split("a,b,c", ",") > > I get this error: Value of type '1-dimensional array of String' > cannot be converted to 'System.Collections.ArrayList'. > > How can I split a string into an arraylist? Armin "Mad Scientist Jr" <usenet_daugh***@yahoo.com> wrote in message Aren't Constructors Wonderful things?news:1140024654.685793.41310@g44g2000cwa.googlegroups.com... > If I try splitting a string into an arraylist > > Dim arrList As New ArrayList > arrList = Split("a,b,c", ",") > > I get this error: Value of type '1-dimensional array of String' cannot > be converted to 'System.Collections.ArrayList'. Creating a new ArrayList /based on/ a String array: Dim arrList As New ArrayList( "a,b,c".Split( ","c ) ) or, to split by a multiple-character delimiter: Imports VB=Microsoft.VisualBasic Dim arrList As New ArrayList( VB.Split( "a<>b<>c", "<>" ) ) HTH, Phill W.
Broken References
check point inside "cirkle" (basketball) Exposing properties of a class within a class Unresponsive UI during lengthy operation ? Windows Services works for years/months/weeks, then chokes New bee:How do i make an .exe file in VS 2005? Count lines in multi-line textbox Can't Figure Out Correct Syntax Using a Structure in a Class Zoom in Cephalometric system |
|||||||||||||||||||||||