![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | number of elements in array Hi, Is there a variable that tells me how many elements there are in an array? thanks, |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: number of elements in array "Frank" <Frank@discussions.microsoft.com> wrote in message news:4EA172A3-070A-465D-A100-C7AE54EB2BEE@microsoft.com... > Hi, > > Is there a variable that tells me how many elements there are in an array? > There is a property called Length on all .NET arrays. Use like so to find out how many elements are in the first dimension of an array: > $arr = 1,2,3,4 > $arr.Length 4 -- Keith |
My System Specs![]() |
| | #3 (permalink) |
| Newbie Rep Power: 11 ![]() | Most collections use Count instead of Length. It is just one of the little inconsistencies in .NET. PowerShell provides an alias property so you can always use COUNT: PS> $a=1,2,3,4,5 PS> $a.Length 5 PS> $a.Count 5 |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Converting array elements between types | Kryten | PowerShell | 6 | 03-01-2008 12:25 PM |
| Support for Adobe photoshop elements 5 or premier elements 3 on Vista 64 bits | Sébastien DELAYRE | Vista General | 5 | 03-26-2007 09:57 AM |
| Get Index Number of Array Item? | ydroam | PowerShell | 8 | 12-18-2006 12:46 PM |
| Get Index Number of Array Item? | ydroam | PowerShell | 0 | 12-15-2006 10:59 AM |
| re-ordering elements in an array? | Marco Shaw | PowerShell | 7 | 11-10-2006 04:25 PM |