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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:35:59+00:00 2026-05-22T14:35:59+00:00

In C#, Array.Find<T>(arrayName, value); searches a one dimensional array. Is there anyway to do

  • 0

In C#,

Array.Find<T>(arrayName, value);

searches a one dimensional array. Is there anyway to do this for a multidimensional array (e.g. myArray[,,])?

  • 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-22T14:35:59+00:00Added an answer on May 22, 2026 at 2:35 pm

    Working with Excel and VSTO, I deal with multidimensional arrays all the time. There are no built-in functions for multidimensional array like Array.Find().

    You basically have two choices: create your own helper methods and implement a generic search pattern there, or generate a list of domain objects correlating to the contents of the multidimensional array. I personally have tended to choose the latter option.

    If you choose to write a helper method, it could look something (very roughly) like this:

    // you could easily modify this code to handle 3D arrays, etc.
    public static class ArrayHelper
    {
        public static object FindInDimensions(this object[,] target, 
          object searchTerm)
        {
            object result = null;
            var rowLowerLimit = target.GetLowerBound(0);
            var rowUpperLimit = target.GetUpperBound(0);
    
            var colLowerLimit = target.GetLowerBound(1);
            var colUpperLimit = target.GetUpperBound(1);
    
            for (int row = rowLowerLimit; row < rowUpperLimit; row++)
            {
                for (int col = colLowerLimit; col < colUpperLimit; col++)
                {
                    // you could do the search here...
                }
            }
    
            return result;
        }
    }
    

    You would refer to the static extension like this in other parts of your application code:

    object[,] myArray = GetMyArray(); // gets an array[,]
    myArray.FindInDimensions(someObject);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

findParent() function find array. There could be one array or more than one. Now
How do I find the nearest value in a numpy array? Example: np.find_nearest(array, value)
How to find an algorithm for calculating the sum value in the array?? Is
I'm using the following code to loop through a multidimensional array and find users
The goal here is to loop through the multidimensional array below and find user's
I am using following to find data. $records = $this->ModelName->find('all', array('fields' => array('name','email'))); It
Are there any php function that do this: $source = array('id1'=>'name', 'id2'=>'name2', 'id3'=>'name3'); $keys
How would I convert the following to a VB.NET predicate using Array.Find? Private Function
When you do Something.find(array_of_ids) in Rails, the order of the resulting array does not
How do I find an item in array which has the most occurrences? [1,

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.