Results 1 to 3 of 3

Thread: [RESOLVED] C# equivalent to PHP implode()

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2006
    Location
    Ithaca, NY
    Posts
    145

    Resolved [RESOLVED] C# equivalent to PHP implode()

    I used the string.split method on a very large string and I need to put it back together. I've used PHP for a long time and with it you just simply use the implode function to do this. What would be the C# equivalent to this function?

  2. #2
    Registered User nmadd's Avatar
    Join Date
    Jun 2007
    Location
    U.S.A.
    Posts
    1,676

    Re: C# equivalent to PHP implode()

    Hi there,
    I'm not too familiar with PHP, but I believe you are looking for String.Join()
    Code:
                string[] str = { "Bob", "eats", "apples", "and", "bananas" };
                MessageBox.Show(string.Join(" ", str));
    Here is the documentation:
    http://msdn2.microsoft.com/en-us/lib...in(vs.80).aspx

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2006
    Location
    Ithaca, NY
    Posts
    145

    Re: C# equivalent to PHP implode()

    That looks like what I've been searching for... It's always something simple.

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width