- 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
Ankith Reddy has Published 1070 Articles
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
658 Views
Timespan shows the length of time.To get the maximum value of TimeSpan, use the following property.TimeSpan.MaxValueExample Live Demousing System; using System.Linq; public class Demo { public static void Main() { Console.WriteLine(TimeSpan.MaxValue); } }Output10675199.02:48:05.4775807
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
173 Views
The WindowsLeft property gets or sets the leftmost position of the console window area relative to the screen buffer.Declare an integer variable to get the leftmost position.int left;Now, use the Console.WindowLeft property.left = Console.WindowLeftLet us see the complete example.Example Live Demousing System; class Demo { static void Main() { ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
133 Views
The Full Date Short Time standard format specifier represents a combination of the long date ("D") and short time ("t") patterns.UseDateTime to set the date.DateTime myDate = new DateTime(2018, 8, 29, 1, 10, 0);Now, use the (“f”) format specifier like this −myDate.ToString("f", CultureInfo.CreateSpecificCulture("en-US"))The following is an example −Example Live Demousing System; ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
711 Views
Use File.Delete method to delete a file.Firstly, set the path of the file you want to delete.String myPath = @"C:\New\amit.txt";Now, use the File.Delete method to delete the file.File.Delete(myPath);The following is the complete code −Example Live Demousing System; using System.IO; public class Program { public static void Main() { ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
682 Views
Initialize Collection like class objects using collection initializer syntax.Firstly, set values for the Employee object −var emp1 = new Employee() { EID = 001, EmpName = "Tim", EmpDept = "Finance"}; var emp2 = new Employee() { EID = 002, EmpName = "Tom", EmpDept = "HR"};Now add this under a collection.IList ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
384 Views
JoinBlocks the calling thread until a thread terminates, while continuing to perform standard COM and SendMessage pumping. This method has different overloaded forms.SleepMakes the thread pause for a period of time.AbortThe Abort method is used to destroy threads.Let us see an example of Join() in threading −Exampleusing System; using System.Diagnostics; ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
2K+ Views
The following is our array −double[] myArr = {20.5, 35.6, 45.7, 55.6, 79.7};To get the first element, use the First() method.myArr.AsQueryable().First();Let us see the complete code −Example Live Demousing System; using System.Linq; using System.Collections.Generic; class Demo { static void Main() { double[] myArr = {20.5, 35.6, 45.7, ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
2K+ Views
Enumerable.Repeat method is part of System.Linq namespace.It returns a collection with repeated elements in C#.Firstly, set which element you want to repeat and how many times.As an example, let us see how to repeat number 10, five times −Enumerable.Repeat(10, 5);The following is the complete example −Example Live Demousing System; using System.Linq; ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
317 Views
Here is the string.string str = "ppqqrr";Now, use Hashset to map the string to char. This will remove the duplicate characters from a string.var res = new HashSet(str);Let us see the complete example −Example Live Demousing System; using System.Linq; using System.Collections.Generic; namespace Demo { class Program { ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
106 Views
With C# 7, you can easily create a ValueType with names.Note − Add System.ValueTuple package to run ValueTuple program.Let’s see how to add it −Go to your projectRight click on the project in the solution explorerSelect “Manage NuGet Packages”You will reach the NuGet Package Manager.Now, click the Browse tab and ... Read More