Masterminds dotnet
Friday, 25 January 2013
To count numbers of specified values in an array using LINQ.
To count numbers of specified values in an array using LINQ.
string
[] str = {
"AA"
,
"DD"
,
"CC"
,
"DD"
,
"EE"
,
"FF"
,
"GG"
,
"AA"
,
"KK"
,
"DD"
};
int
nCount = str.Count(m => m.Equals(
"DD"
));
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment