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

  • Home
  • SEARCH
  • 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 7965773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:14:40+00:00 2026-06-04T06:14:40+00:00

I have a int array with for example {1,2,3,4} value. I want to put

  • 0

I have a int array with for example {1,2,3,4} value.

I want to put this numbers into, for example, my list box like this :

listBox2.Items.Add("After Inserting (" + page[i].ToString() + ')' + <use all my numbers like this : 1234 here>+"Page Fault = " + pf.ToString());  

Output :

After Inserting (3) 1234 page fault = 5

1234 is just an example. My array is much bigger.

How can I do that in c#?

  • 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-04T06:14:42+00:00Added an answer on June 4, 2026 at 6:14 am

    You can use String.Join (actually the IEnumerable<T> overload is taken):

    String joined = String.Join("", yourArray); 
    

    i’m new in c# how i dont know how place the string among the text

    You can use String.Format to build the text and to increase readability:

    var inserted = page[i].ToString();
    var allInserted = String.Join("", yourArray);
    var pageFault = pf.ToString();
    var itemText = String.Format("After Inserting ({0}) {1} page fault = {2}"
                                 ,inserted, allInserted, pageFault);
    listBox2.Items.Add(itemText);
    

    Edit 2:

    can i replace some Character instead one number in array? my array :
    {1,2,3,4,-1″} output : 1,2,3,4,empty

    Yes, you can replace the output:

    String.Join("", yourArray.Where(i => i != -1));
    

    Edit 3:

    i understand how i can exclude -1 but i didn’t understand how i can
    replace something with that…like “empty” instead -1

    Here we go …

    String.Join(", ", intArray.Select(i => i == -1 ? "empty" : i.ToString()));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to output an array containing numbers. I'm creating the array like this
I want to do something like this. typedef struct Test{ int value; struct Test*
i have an array like below int[] array = new array[n];// n may be
Suppose I have a sorted array of integers int[] , and I want to
I have a list in which i want to be able to put different
Suppose I have an int-array and I want to modify it. I know that
I have an array of integers say int[] vals . I want to use
I have a part of a URL like this: /home/{value1}/something/{anotherValue} Now i want to
I have 1000 float datas in an array. I want to separate into different
I have an int array containing gray scale values from 0-254, i also have

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.