Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9002077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:31:19+00:00 2026-06-16T00:31:19+00:00

I have created a Word Merge routine that i use personally. When I add

  • 0

I have created a “Word Merge” routine that i use personally. When I add items into my 3 text boxes, and then merge, everything looks fine. but when i copy to a clipboard, there are extra carriage returns that I didn’t see before. Can anyone help? I have attached the code and two images of the results below:

private void button25_Click(object sender, EventArgs e)
{
    char[] delimiterChars2 = { ',', ':', '|', '\n' };

    List<string> listBox1 = new List<string>(textBox_MergeList1.Text.Split(delimiterChars2));
    List<string> listBox2 = new List<string>(textBox_MergeList2.Text.Split(delimiterChars2));
    List<string> listBox3 = new List<string>(textBox_MergeList3.Text.Split(delimiterChars2));

    string outputDelimiter = "-";            

    var result = from s1 in listBox1
                 from s2 in listBox2
                 from s3 in listBox3
                 select s1 + outputDelimiter + s2 + outputDelimiter + s3;

    foreach (var item in result)
    {
        textBox_MergeListResults.Text = String.Join("\r\n", result);
    }

    Clipboard.SetText(textBox_MergeListResults.Text);
}

I’m pretty sure it has to do with my delimiter splitting in the beginning, because if i just use the following, i don’t have any issues:

List<string> listBox1 = new List<string>() { "A", "B", "C" };
List<string> listBox2 = new List<string>() { "1", "2", "3" };
List<string> listBox3 = new List<string>() { "Dogs", "Cats", "Pigs" }; 

Image of output results: http://screencast.com/t/zu49GgOok1m

Image of clipboard results: http://screencast.com/t/SqmJqFmqT

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:31:20+00:00Added an answer on June 16, 2026 at 12:31 am

    EDIT:

    Answered in chat after playing around with it.

    Requires splitting on \r and \n. Then joining back with \r and \n too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a Word template that I am then processing via the OpenXML
I have created a full-text catalog and I use full text index on some
I have created a Word add-in which would load data in custom ribbon from
I have created a template in Word 2007 with several fields that I want
I'm trying to create a simple Word add-in. I have created a Word 2010
I have created a word dictionary that uses PHP and XML. The user enters
I have created a simple website, that lists word documents stored on our server.
I have code that writes text to a Word document (non-XML) and saves it
I have created this function to check abecedarian with while loop (A word is
I have basic hello word example of Prime Faces. I have created dynamic web

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.