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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:54:02+00:00 2026-05-22T12:54:02+00:00

I’m currently working on this sample code of mine wherein I want to display

  • 0

I’m currently working on this sample code of mine wherein I want to display an array of numbers coming from the server to the client screen.

Basically, I first make the server create an array of 99 randomly generated numbers who’s values are from 1 – 100, convert the array into a string and then transport the string to the server using Byte sending.

The code looks like:

//SERVER
int[] result = GenerateNumbers();
string resultingString = "";
for (int i = 0; i < result.Length; i++)
     resultingString = resultingString + result[i] + ",";
s.Send(asen.GetBytes(resultingString));

//CLIENT
byte[] bb = new byte[1000];
int k = stm.Read(bb, 0, 1000);

for (int i = 0; i < k; i++)
{
     Console.Write(Convert.ToChar(bb[i]));
}

Now what I want to do is to show the resulting array in the client screen. My code currently can do that. However, with the Console.Write() command, it continuously displays the string until it ends. As in the below example:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 ... 93 94 95 96 97 98 99

What I want to do now is to make the display formatted like this:

 1  2  3  4  5  6  7  8  9 10
11 12 13 14 15 16 17 18 19 20
21 22 23  . . . . . . . . . . 
90 91 92 93 94 95 96 97 98 99

Can someone please point me to a good way to do this? 🙂

  • 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-05-22T12:54:03+00:00Added an answer on May 22, 2026 at 12:54 pm

    String.PadLeft is what you’re after – this’ll pad the left hand side of a given string to make it n characters long, using the padding character of your choosing.

    To break every nth number you need (after your Console.Write(…);):

    if((i % n) == 0) {
      Console.WriteLine();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently running into a problem where an element is coming back from
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Does anyone know how can I replace this 2 symbol below from the string
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
i want to parse a xhtml file and display in UITableView. what is the

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.