- 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
2K+ Views
This method returns true if the entered string has only whitespace characters or is null.Let say you checked for null value −bool val1 = string.IsNullOrWhiteSpace(null);The above returns True, since the string is “null”. In the same way, check it for whitespace character.Here is the entire example that checks for null ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
177 Views
The General Date Long Time standard format specifier is a combination of the short date ("d") and long time ("T") patterns, separated by a space.Set the date −DateTime dt = new DateTime(2018, 1, 3, 3, 45, 20);Now, use the ToString() method and DateTimeFormatInfo.dt.ToString("G", DateTimeFormatInfo.InvariantInfo)Example Live Demousing System; using System.Globalization; class Demo ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
319 Views
The Short Time format specifier represents a custom date and time format string.It is defined by the current DateTimeFormatInfo.ShortTimePattern property.For example, the custom format string is −HH:mmExample Live Demousing System; using System.Globalization; class Demo { static void Main() { DateTime date = new DateTime(2018, 5, 4, 10, ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
3K+ Views
Convert a specified value to a decimal number using the Convert.ToDecimal() method.We have a string here.string stringVal = "2, 345.26";Now, let us use the Convert.ToDecimal() method to convert it to a decimal number.decimal decimalVal; decimalVal = System.Convert.ToDecimal(stringVal);Let us now see the complete example −Example Live Demousing System; public class Demo { ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
6K+ Views
Use the Convert.ToInt64() method to convert Decimal to Int64 (long) in C#.Let’s say we have a decimal variable.decimal d = 310.23m;Now to convert it to Int64, use the Convert.ToInt64() method.long res; res = Convert.ToInt64(d);Let us see another example −Example Live Demousing System; class Demo { static void Main() { ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
6K+ Views
The hexadecimal ("X") format specifier is used to convert a number to a string of hexadecimal digits.Set the case of the format specifier for uppercase or lowercase characters to be worked on hexadecimal digits greater than 9.Let us understand this with an example −“X” for PQR, whereas “x” for pqrExample Live ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
694 Views
If a directory you are trying to find does not exist, then DirectoryNotFoundException occurs.Here, we are try to find a directory that does not exist using GetDirectories() method.Exampleusing System.IO; using System; class Program { static void Main() { Directory.GetDirectories("D:ew\"); } }The above code will generate ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
416 Views
Let’s say you have a ValueTuple and would like to convert it to a tuple, then use the ToTuple() method.With C#, we can easily convert a ValueTuple to a Tuple using ToTuple() method.Note − Add System.ValueTuple package to run ValueTuple program.Let’s see how to add it −Go to your projectRight ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
193 Views
To handle File Paths in C#, use the Path methods. These methods come under System.IO Namespace.Some of them are −GetExtensionRetrieve the extension of the file using the GetExtension() method.For example, .txt, .dat, etc.GetFileNameRetrieve the name of the file using the GetFileName() method.For example, new.txt, details.dat, etc.GetFileNameWithoutExtensionRetrieve the name of the ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
385 Views
With C#, we can easily convert a ValueTuple to a Tuple using ToTuple() method.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 ... Read More