This is not the most glamorous way but works.
(must have using System.Linq;
)
int maxValue = anArray.Max();
int maxIndex = anArray.ToList().IndexOf(maxValue);
More Related Contents:
- Find index of returned list result C#
- Sum multidimensional array over dimensions [closed]
- C# how to create an array of objects? [closed]
- how to write every element of an array in a line of a textbox C# [closed]
- Convert string[] to Array
- How can I get more than one random numbers in a specific range using C#?
- How do I divide an array into separate arrays in C#?
- Cannot deserialize the JSON array (e.g. [1,2,3]) into type ‘ ‘ because type requires JSON object (e.g. {“name”:”value”}) to deserialize correctly
- Array slices in C#
- How do I concatenate two arrays in C#?
- Are arrays or lists passed by default by reference in c#?
- How do I convert a Stream into a byte[] in C#? [duplicate]
- change array size
- Convert json to a C# array?
- Check if a value is in an array (C#)
- How do I sort a two-dimensional (rectangular) array in C#?
- Array Size (Length) in C#
- Passing Arrays by Value and by Reference
- Checking if a string array contains a value, and if so, getting its position
- finding closest value in an array
- Convert array of integers to comma-separated string
- List array duplicates with count
- Converting jagged array to 2D array C#
- Sorting an array related to another array
- Why does my C# array lose type sign information when cast to object?
- How to sort two arrays by same index?
- C# multidimensional arrays iteration
- Why is array co-variance considered so horrible?
- byte[] to unsigned BigInteger?
- Byte Array to Bitmap Image