The System.Array class of learning to use asp.net

Source: Internet
Author: User
Tags filter foreach array copy count net sort tostring

Members:

/* Static method * *
Array.asreadonly ()//packaging is read-only (ReadOnlyCollection)
Array.BinarySearch ()///Use the binary lookup method to find the first order
Array.clear ()//
Array.constrainedcopy ()//constraint replication
Array.convertall ()//
Array.copy ()//
Array.CreateInstance ()//set up and initialized
Array.equals ()//
Array.exists ()//determine if the element of the specified condition exists
Array.find ()///Find the First Qualifying element
Array.findall ()///Find all eligible elements
Array.findIndex ()//Get the index of the first qualifying element
Array.findlast ()///Find the last qualifying element
Array.findlastindex ()//Get the index of the last qualifying element
Array.foreach ()//loop operation of each element
Array.indexof ()//Search index of first matching element
Array.lastindexof ()//search for the index of the last matching element
Array.resize ()//Set Length
Array.reverse ()//Flip (one-dimensional array)
Array.Sort ()//Sort
Array.trueforall ()//Whether each element meets the specified criteria
 
/* Properties * *
Isfixedsize; Whether the size is fixed
IsReadOnly; is read-only
issynchronized; is thread safe
Length; //
Longlength; Length (Int64)
Rank; Number of dimensions of an array
SyncRoot; Synchronizing objects
 
/* Method * *
Clones ()//clone shallow copies
CopyTo ()///Copy to
Equals ()//
GetEnumerator ()//Get Enumerator (IEnumerator)
GetHashCode ()//
GetLength ()//Same Length property
Getlonglength ()//Same Longlength property
Getlowerbound ()//Get subscript for specified dimension
GetType ()//
GetUpperBound ()//Get superscript for the specified dimension
GetValue ()//value
SetValue ()//Assign Value
ToString ()//
 
Aggregate<> ()//Additive
All<> ()//whether all conditions are met
Any<> ()//whether there is a satisfying condition
Asenumerable<> ()//Convert to Ienumerable<t>
AsParallel ()///Convert to ParallelQuery for parallel query
Asparallel<> ()//
AsQueryable ()//Convert to IQueryable
Asqueryable<> ()//
Average ()//Average
Average<> ()//
Cast<> ()//conversion type to IEnumerable
Concat<> ()//connection
Contains<> ()//is included
Count<> ()//Total
Defaultifempty<> ()//specify default NULL value
Distinct<> ()//Remove repetition
Elementat<> ()//Get the element at the specified location
Elementatordefault<> ()//ElementAt, but returns default null value if get failed
Except<> ()//difference Set
First<> ()//Get first element
Firstordefault<> ()//same, but get failed returns default NULL value
Groupby<> ()//Group
Groupjoin<> ()//Association grouping
Intersect<>//Intersection
Join<> ()//series
Last<> ()//Get last element
Lastordefault<> ()//same last, but get failed returns default NULL value
Longcount<> ()//same Count, but returns Int64
Max ()//MAX value
Max<> ()//
MIN ()//min value
Min<> ()//
Oftype<> ()///filter to IEnumerable
Orderby<> ()//Sort
Orderbydescending<> ()//inverted sort
Reverse<> ()//Flip
Select<> ()//mapping
Selectmany<> ()//depth mapping
Sequenceequal<> ()//is equal
Single<> ()//Fetch is only a unique element, not unique or get no exception
Singleordefault<> ()//Get just the only element, not an exception, get the default null value
Skip<> ()///After obtaining the specified serial number
Skipwhile<> ()//After obtaining the specified condition
SUM ()//Sum
Sum<> ()//
Take<> ()//get before the specified ordinal
Takewhile<> ()///get before the specified condition
Toarray<> ()//Generate array
Todictionary<> ()//Generate Dictionary<tkey, tvalue>
Tolist<> ()//Build list<t>
Tolookup<> ()//Generate Lookup<tkey, telement>
Union<> ()//and set
Where<> ()//filter
Zip<> ()/merge
Array.asreadonly ():

protected void Button1_Click (object sender, EventArgs e)
{
Int[] NArr1 = {11, 22, 33};
 
readonlycollection<int> nArr2 = array.asreadonly (NARR1);
ilist<int> nArr2 = array.asreadonly<int> (NARR1);
ilist<int> nArr2 = array.asreadonly (NARR1);
 
try {narr2[0] = 123;}
catch (Exception err) {Response.Write (err. message); The//collection is read-only.
 
for (int i = 0; i < narr1.length i++) {Narr1[i] + = 1;}
 
String str = "";
foreach (int n in nArr2) {str + + n.tostring () + "";} 12 23 34
 
TextBox1.Text = str;
}



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.