Monday, March 2, 2009
Combine Array values to String
Hi, in this section I wanted to tell you a simple way to combine an Array of values in
to string delimited by a character. We can do this very easily by using "String.Join". Below is a simple example as how we can do this.
Dim aTemp As String() = {"1", "14", "23", "7", "13", "37", "143"}
Dim sDelimiter As String = ","
MsgBox(String.Join(sDelimiter, aTemp))
We need not loop through and combine with some logic which will even increase the processing time, this function will do it as we wanted. We can specify what ever delimiter we want.
Hope this will help you at some point of time. Happy Coding :)
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment