
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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
Samual Sam has Published 2310 Articles

Samual Sam
260 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
467 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
4K+ 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
8K+ 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
8K+ 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
828 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
556 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
265 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
521 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

Samual Sam
326 Views
Firstly, set two lists in C#.List OneList list1 = new List (); list1.Add("P"); list1.Add("Q"); list1.Add("R"); list1.Add("S"); list1.Add("T"); list1.Add("U"); list1.Add("V"); list1.Add("W");List TwoList list2 = new List (); list2.Add("T"); list2.Add("U"); list2.Add("V"); list2.Add("W");Now, to get the different values in both the lists, use the Except method. It returns the ... Read More