Baris.NET
Wednesday, March 21, 2007
.NET: Combine array items into a string (deliminated with comma)
So, here is the quick way to achieve it:
ArrayList arr
= new
ArrayList()
;
arr.Add(
"test1"
)
;
arr.Add(
"test2"
)
;
arr.Add(
"test3"
)
;
//be sure all elements are string
string
str
=
String.Join(
","
, (
string
[]) arr.ToArray(Type.GetType(
"System.String"
)))
;
MessageBox.Show(str)
;
// test1,test2,test3
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment