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 9214437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:58:24+00:00 2026-06-18T01:58:24+00:00

I am trying to create a string that inserts a duplicate letter from the

  • 0

I am trying to create a string that inserts a duplicate letter from the original into the modified. For example, the output of one run would be:

Original word:

stack

Output:

sstack, sttack, staack, stacck, stackk

Does that make sense? I have this so far, and I feel i am close, but I am suing the wrong method to reassemble the string. Any help would be appreciated:

 // Use ToCharArray to convert string to array.                
 char[] array = originalWord.ToCharArray();

 // Loop through array.
 for (int i = 0; i < array.Length; i++)
 {
    // Get character from array.
    char letter = array[i];
    string result = array.ToString();
    string result2 = string.Join("", result.Select(x => x + letter));
    Console.Write(result2);
 }
  • 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-18T01:58:25+00:00Added an answer on June 18, 2026 at 1:58 am

    This should work:

    var original = "stack";
    for (int i = 0; i < original.Length; i++)
        Console.WriteLine(original.Insert(i, original[i].ToString()));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a string that has a set amount of different words
I'm trying to create a string array with lines of codes, so that the
I am trying to create a table with values that are in a String
I'm trying to create a JQuery function that will test a string for the
I am trying to add string values in JsonArray and after that create Json
What I am trying to do, is create a method, that has a string
I'm trying to create sql statement in TSQL that looks like this: INSERT INTO
Possible Duplicate: outputting values from database into html table PHP I am trying to
I am trying to create a function that inserts spaces between the characters of
I'm trying to create a trigger that will associate an unique random string to

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.