Prev: Generate value of control's property runtime
Next: Preserving character attributes in a RichTextBox
From: Zach on 22 Mar 2010 06:12 Using blabla.Split(whatever) you can split up a text-line into its constituent elements of an array (as you will know well), my question: is there code to do the opposite, say after you have nullified one of the elements of the array? Please give simple example, no reference or lecture. Many thanks, Zach.
From: Zach on 22 Mar 2010 06:17 On 22/03/2010 11:12, Zach wrote: > Using blabla.Split(whatever) you can split up a text-line into its > constituent elements of an array (as you will know well), my question: > is there code to do the opposite, say after you have nullified one of > the elements of the array? Please give simple example, no reference or > lecture. > > Many thanks, > Zach. > > > PS I am aware that you can stick the elements together in a loop but that is not what I am after. Zach
From: Andy O'Neill on 22 Mar 2010 06:35 "Zach" <xx.xx(a)xx> wrote in message news:4ba74399$0$28141$5fc3050(a)news.tiscali.nl... > On 22/03/2010 11:12, Zach wrote: >> Using blabla.Split(whatever) you can split up a text-line into its >> constituent elements of an array (as you will know well), my question: >> is there code to do the opposite, say after you have nullified one of >> the elements of the array? Please give simple example, no reference or >> lecture. >> >> Many thanks, >> Zach. >> >> >> > PS I am aware that you can stick the elements together in a loop but that > is not what I am after. > > Zach On the face of it, iterating through your array or collection of words and concatenating non-null entries onto a stringbuilder in a loop would be the way to do it. What's the problem with that?
From: Zach on 22 Mar 2010 06:40 On 22/03/2010 11:35, Andy O'Neill wrote: > > "Zach" <xx.xx(a)xx> wrote in message > news:4ba74399$0$28141$5fc3050(a)news.tiscali.nl... >> On 22/03/2010 11:12, Zach wrote: >>> Using blabla.Split(whatever) you can split up a text-line into its >>> constituent elements of an array (as you will know well), my question: >>> is there code to do the opposite, say after you have nullified one of >>> the elements of the array? Please give simple example, no reference or >>> lecture. >>> >>> Many thanks, >>> Zach. >>> >>> >>> >> PS I am aware that you can stick the elements together in a loop but >> that is not what I am after. >> >> Zach > > On the face of it, iterating through your array or collection of words > and concatenating non-null entries onto a stringbuilder in a loop would > be the way to do it. > What's the problem with that? Well, there is nothing wrong with that, true, but given the Split option, I thought there might be an opposite of Split. Because you don't need Split, to split up a string, code not so complicated to do that either :) Zach
From: Family Tree Mike on 22 Mar 2010 07:07 On 3/22/2010 6:40 AM, Zach wrote: > On 22/03/2010 11:35, Andy O'Neill wrote: >> >> "Zach" <xx.xx(a)xx> wrote in message >> news:4ba74399$0$28141$5fc3050(a)news.tiscali.nl... >>> On 22/03/2010 11:12, Zach wrote: >>>> Using blabla.Split(whatever) you can split up a text-line into its >>>> constituent elements of an array (as you will know well), my question: >>>> is there code to do the opposite, say after you have nullified one of >>>> the elements of the array? Please give simple example, no reference or >>>> lecture. >>>> >>>> Many thanks, >>>> Zach. >>>> >>>> >>>> >>> PS I am aware that you can stick the elements together in a loop but >>> that is not what I am after. >>> >>> Zach >> >> On the face of it, iterating through your array or collection of words >> and concatenating non-null entries onto a stringbuilder in a loop would >> be the way to do it. >> What's the problem with that? > > Well, there is nothing wrong with that, true, but given the Split > option, I thought there might be an opposite of Split. Because you don't > need Split, to split up a string, code not so complicated to do that > either :) > > Zach It sounds like you are looking for string.Join(token, items []); http://msdn.microsoft.com/en-us/library/57a79xd0.aspx -- Mike
|
Next
|
Last
Pages: 1 2 3 Prev: Generate value of control's property runtime Next: Preserving character attributes in a RichTextBox |