- 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
Karthikeya Boyini has Published 2383 Articles
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
4K+ Views
Filter collections using Where clause in C#. A single query expression may have multiple where clauses.Firstly, set a collection −IList employee = new List() { new Employee() { EmpID = 1, EmpName = "Tom", EmpMarks = 90, Rank = 8} , new Employee() { EmpID = 2, EmpName ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
330 Views
Firstly, create a tuple as shown below that calls a method.var tuple = Show();The above statement calls the following method −static Tuple Show()Under the method, return the tuple as shown below −Example Live Demousing System; public class Demo { public static void Main() { var tuple = ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
636 Views
This round-trip ("R") format specifier is supported for the Single, Double, and BigInteger types.It ensures that a numeric value converted to a string is parsed back into the same numeric value.Let us see an example −Firstly, we have a double variable.double doubleVal = 0.91234582637;Now, use the ToString() method: and set ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
223 Views
If a File you are trying to find does not exist, then FileNotFoundException occurs.Here, we are try to find a file that does not exist using StreamReader() method.reader = new StreamReader("new.txt"))To read it we have used the following method −reader.ReadToEnd();Let us see the complete code.Exampleusing System.IO; using System; class Program ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
367 Views
Firstly, set a list and add elements.List myList = new List(); myList.Add("Jennings"); myList.Add("James"); myList.Add("Chris");Let’s say you need to delete the element “James” now. For that, use the Remove() method.myList.Remove("James");Here is the complete code.Example Live Demousing System.Collections.Generic; using System; class Program { static void Main() { List myList ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
2K+ Views
Set an array.int[] array = new int[] { 50, 100, 150, 200, 250, 300, 350, 400 };Now, if you will print this array using a loop and new line, then the arrays will be visible vertically.To work it horizontally, use the Join() method and set spaces to separate array elements.string.Join(" ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
7K+ Views
Let’s say the following is the string −StringBuilder str = new StringBuilder("Patience is key!");To remove whitespace, you can use the replace method.str.Replace(" ", "");Let us see the complete code.Example Live Demousing System; using System.Text; class Demo { static void Main() { // Initial String ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
6K+ Views
To represent Int632as a Binary string in C#, use the ToString() method and set the base as the ToString() method’s second parameter i.e. 2 for Binary.Int32 represents a 32-bit signed integer.Firstly, set an Int64 variable −int val = 30;Now, convert it to a binary string by including 2 as the ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
5K+ Views
Set two arrays.var val = new [] { 20, 40, 60}; var str = new [] { "ele1", "ele2", "ele3"};Use the zip() method to process the two arrays in parallel.var res = val.Zip(str, (n, w) => new { Number = n, Word = w });The above fetches both the arrays ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
9K+ Views
Use Hashset to remove duplicate characters.Here is the string −string myStr = "kkllmmnnoo";Now, use HashSet to map the string to char. This will remove the duplicate characters from a string.var unique = new HashSet(myStr);Let us see the complete example −Example Live Demousing System; using System.Linq; using System.Collections.Generic; namespace Demo { ... Read More