

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Return the total elements in a sequence as a 64-bit signed integer in C#
Firstly, set a string array.
string[] num = { "One", "Two", "Three", "Four", "Five"};
Use the Linq LongCount method to get the count of elements.
num.AsQueryable().LongCount();
Here is the complete code −
Example
using System; using System.Collections.Generic; using System.Linq; class Demo { static void Main() { string[] num = { "One", "Two", "Three", "Four", "Five"}; long res = num.AsQueryable().LongCount(); Console.WriteLine("{0} elements", res); } }
Output
5 elements
- Related Questions & Answers
- Reinterpret 64-bit signed integer to a double-precision floating point number in C#
- Implicit conversion from 64-bit signed integer (long) to Decimal in C#
- Convert the specified double-precision floating point number to a 64-bit signed integer in C#
- Convert Decimal to the equivalent 64-bit unsigned integer in C#
- Implicit conversion from 8-bit signed integer (SByte) to Decimal in C#
- Compute the bit-wise NOT of an array with signed integer type in Numpy
- Difference between 32-bit and 64-bit operating systems
- Differentiate between 32-Bit vs. 64-Bit Operating System.
- Compile 32-bit program on 64-bit gcc in C and C++
- C# Program to skip elements from a sequence as long as the specified condition is true
- Difference between signed and unsigned integer in Arduino
- C# Program to return specified number of elements from the beginning of a sequence
- Shift the bits of an integer to the right and set the count of shifts as an array with signed integer type in Numpy
- How to compile 32-bit program on 64- bit gcc in C and C++
- Generate an integer sequence in MySQL?
Advertisements