- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Samual Sam has Published 2492 Articles
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
62 Views
The length property is used to gets or sets the number of elements in the BitArray.Our BitArray.BitArray arr = new BitArray( 5 );To calculate the length, use the length property.Console.WriteLine( "Length: {0}", arr.Length );You can try to run the following code to learn how to work with Length property of ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
3K+ Views
To create a string object in C#, use any of the below given method.By assigning a string literal to a String variableBy using a String class constructorBy using the string concatenation operator (+)By retrieving a property or calling a method that returns a stringBy calling a formatting method to convert ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
2K+ Views
To compress and decompress files using GZIP Format, use the GZipStream class.CompressTo zip a file, use the GZipStream class with the FileStream class. Set the following parameters.File to be zipped and the name of the output zip file.Here, outputFile is the output file and the file is read into the ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
151 Views
C# allows multidimensional arrays. Declare a 2-dimensional array of int as.int [ , , ] a;The simplest form of the multidimensional array is the 2-dimensional array. A 2-dimensional array is a list of one-dimensional arrays.The following is a two-dimensional array with 3 rows and 4 columns.Let us now see an ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
2K+ Views
Firstly, declare and initialize two numbers.int num1 = 35; int num2 = 55;With that, use if- else to find the minimum number.if (num1 < num2) { minNum = num1; } else { minNum = num2; }Above, we have set the minimum value to the variable minNum and printed ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
3K+ Views
Initialize the array.int[] myArr = new int[5] {98, 76, 99, 32, 77};Compare the first element in the array with the next element to find the largest element, then the second largest, etc.if(myArr[i] < myArr[j]) { temp = myArr[i]; myArr[i] = myArr[j]; myArr[j] = temp; }Above, i and ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
4K+ Views
Dictionary is a collection of keys and values in C#. Dictionary is included in the System.Collection.Generics namespace.The following are the methods −Sr.NoMethod & Description1AddAdd key-value pairs in Dictionary2Clear()Remove all keys and values3RemoveRemoves the element with the specified key.4ContainsKeyChecks whether the specified key exists in Dictionary.5ContainsValueChecks whether the specified key value ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
2K+ Views
Use the System.IO.Compression Namespace in C# to compress and decompress files in C#.CompressTo zip a file, use the GZipStream class with the FileStream class. Set the following parameters: File to be zipped and the name of the output zip file.Here, outputFile is the output file and the file is read ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
178 Views
Asynchronous programming in C# is an efficient approach towards activities blocked or access is delayed. If an activity is blocked like this in a synchronous process, then the complete application waits and it takes more time. The application stops responding. Using asynchronous approach, the applications continues with other tasks as ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
9K+ Views
Use the File.exists method in C# to check if a file exits in C# or not.Firstly, check whether the file is present in the current directory.if (File.Exists("MyFile.txt")) { Console.WriteLine("The file exists."); }After that check whether the file exist in a directory or not.if (File.Exists(@"D:\myfile.txt")) { Console.WriteLine("The file exists."); ... Read More