Opposite of split

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dwight

    #1

    Opposite of split

    Is there an easy way to merge a string array into one string?


  • Alan Pretre

    #2
    Re: Opposite of split

    "dwight" <dwight@discuss ions.microsoft. com> wrote in message
    news:55AF690A-1482-4B01-B9C5-551A1B42DA06@mi crosoft.com...[color=blue]
    > Is there an easy way to merge a string array into one string?[/color]

    Use string.Join(). It is a static.

    -- Alan


    Comment

    • Ignacio Machin \( .NET/ C# MVP \)

      #3
      Re: Opposite of split

      Hi,

      What about +
      string targer = "str1" + "ste2";

      Remember that string is an inmutable class, meaning that you will get a new
      instance, no the same with something appened, if you just want to append
      several substrings it''s better tu use StringBuilder

      cheers,

      --
      Ignacio Machin,
      ignacio.machin AT dot.state.fl.us
      Florida Department Of Transportation



      "dwight" <dwight@discuss ions.microsoft. com> wrote in message
      news:55AF690A-1482-4B01-B9C5-551A1B42DA06@mi crosoft.com...[color=blue]
      > Is there an easy way to merge a string array into one string?
      >
      >[/color]


      Comment

      Working...