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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:11:06+00:00 2026-06-02T21:11:06+00:00

Besides using a loop. An int array can be initialized with 0s easy like

  • 0

Besides using a loop. An int array can be initialized with 0s easy like arr = Enumerable.Range(0, 100).Select(i => new int[100]).ToArray();.

Is there a way I can initialize a string or char array in a similar fashion?

  • 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-02T21:11:08+00:00Added an answer on June 2, 2026 at 9:11 pm

    I think you’re looking for:

    string[] arrayOfStringZeros = Enumerable.Range(0, 100)
                                            .Select(i => "0")
                                            .ToArray();
    
    
    char[] arrayOfCharZeros = Enumerable.Range(0, 100)
                                       .Select(i => '0')
                                       .ToArray();
    

    Updated

    char[][] jaggedOfCharZeros = Enumerable.Range(0, 100)
                                           .Select(i => Enumerable.Range(0, 100)
                                                                  .Select(j => '0')
                                                                  .ToArray())
                                           .ToArray();
    

    Actually it would probably be slightly more efficient to do:

    char[] initZeros = Enumerable.Range(0, 100)
                                 .Select(i => '0')
                                 .ToArray();
    
    
    char[][] jaggedOfCharZeros = Enumerable.Range(0, 100)
                                           .Select(i => (char[])initZeros.Clone())
                                           .ToArray();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

besides using Hive, is it a good idea in order to execute ad hoc
What's the advantage of using malloc (besides the NULL return on failure) over static
Besides readability is there any significant benifit to using a CASE WHEN statement vs
Are there any advantages of using one over the other besides readability?
Besides polling , how can I tell when a long-running Amazon EC2 operation is
So I'm trying to compare points currently, and I'm using a small loop and
I´m all new to scraping and I´m trying to understand xpath using R. My
Besides using Web Services, or POX (or custom HTTP), are there some other techniques
How do I use <select> <option>numbers1-100</option> </select> I have to use 1 to 100
With jquery, besides using the $(selector) syntax, there is also a syntax that is

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.