Get Number of Objects Returned By CultureInfo.GetCultures Method ?

C

clintonG

I need help learning how to get the number of objects that are
returned from the CultureInfo.GetCultures method which
returns an array of objects.

--
<%= Clinton Gallagher
A/E/C Consulting, Web Design, e-Commerce Software Development
Wauwatosa, Milwaukee County, Wisconsin USA
NET (e-mail address removed)
URL http://www.metromilwaukee.com/clintongallagher/
 
J

John Baro

Array.GetUpperBound(0) +1 or
Array.GetLength(0)
both will return the length of the first element of the array.
HTH
JB
 
C

clintonG

Creating the object array...

foreach( CultureInfo ci in
CultureInfo.GetCultures( CultureTypes.AllCultures ) )
{
int cultureCount = Array.GetLength(ci);
}

But I'm using the Array.GetLength method wrong. As shown causes an error.

<%= Clinton Gallagher
 
J

John Baro

public int GetCultureInfoCount()
{
CultureInfo[] CIA = CultureInfo.GetCultures(CultureTypes.AllCultures);
return CIA.GetLength(0);
}

HTH
JB
 
C

clintonG

Much better. Thank you.

<%= Clinton Gallagher

John Baro said:
public int GetCultureInfoCount()
{
CultureInfo[] CIA = CultureInfo.GetCultures(CultureTypes.AllCultures);
return CIA.GetLength(0);
}

HTH
JB

Creating the object array...

foreach( CultureInfo ci in
CultureInfo.GetCultures( CultureTypes.AllCultures ) )
{
int cultureCount = Array.GetLength(ci);
}

But I'm using the Array.GetLength method wrong. As shown causes an error.

<%= Clinton Gallagher
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top