
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
Found 26504 Articles for Server Side Programming

127 Views
The BitConverter.ToBoolean() method in C# returns a Boolean value converted from the byte at a specified position in a byte array.SyntaxFollowing is the syntax −public static bool ToBoolean (byte[] arr, int startIndex);Above, arr is a byte array, whereas startIndex is the index of the byte within a value.ExampleLet us now see an example to implement the BitConverter.ToBoolean() method −using System; public class Demo { public static void Main(){ byte[] arr = { 50, 100 }; Console.WriteLine("Array values..."); for (int i = 0; i < arr.Length; i++) { ... Read More

3K+ Views
The DateTime.IsLeapYear() method in C# is used to check whether the specified year is a leap year. The return value is a boolean, with TRUE if the year is a leap year, else FALSE.SyntaxFollowing is the syntax −public static bool IsLeapYear (int y);Above, y is the year to be checked, 2010, 2016, 2019, etc.ExampleLet us now see an example to implement the DateTime.IsLeapYear() method −using System; public class Demo { public static void Main() { int year = 2019; Console.WriteLine("Year = "+year); if (DateTime.IsLeapYear(year)){ Console.WriteLine("Leap Year!"); ... Read More

400 Views
The DateTime.IsDaylightSavingTime() method in C# is used to indicate whether this instance of DateTime is within the daylight saving time range for the current time zone.SyntaxFollowing is the syntax −public bool IsDaylightSavingTime ();ExampleLet us now see an example to implement the DateTime.IsDaylightSavingTime() method −using System; public class Demo { public static void Main() { DateTime d = new DateTime(2019, 10, 11, 7, 10, 40); bool res = d.IsDaylightSavingTime(); if (res) Console.WriteLine("TRUE: This instance of DateTime is within the daylight saving time range for the current time ... Read More

77 Views
he DateTime.GetTypeCode() method in C# is used to return the TypeCode for value type DateTime. The returned value is the enumerated constant, DateTime.SyntaxFollowing is the syntax −public TypeCode GetTypeCode ();ExampleLet us now see an example to implement the DateTime.GetTypeCode() method −using System; public class Demo { public static void Main() { DateTime d = DateTime.Now; TypeCode res = d.GetTypeCode(); Console.WriteLine("TypeCode of Date {0} = {1} ", d, res); } }OutputThis will produce the following output −TypeCode of Date 10/16/2019 7:08:50 AM = DateTimeExampleLet us now see another example to ... Read More

643 Views
The DateTime.GetHashCode() method in C# is used to returns the hash code for this instance. This return value is a 32-bit signed integer hash code.SyntaxFollowing is the syntax −public override int GetHashCode ();ExampleLet us now see an example to implement the DateTime.GetHashCode() method −using System; public class Demo { public static void Main() { DateTime d = new DateTime(2019, 11, 10, 7, 20, 45); int res = d.GetHashCode(); Console.WriteLine("HashCode for date {0} = {1}", d, res); } }OutputThis will produce the following output −HashCode for date 11/10/2019 7:20:45 AM ... Read More

1K+ Views
The DateTime.GetDateTimeFormats() method in C# is used to convert the value of this instance to all the string representations supported by the standard date and time format specifiers.SyntaxFollowing is the syntax −public string[] GetDateTimeFormats () public string[] GetDateTimeFormats (char ch);Above, ch is a standard date and time format string.ExampleLet us now see an example to implement the DateTime.GetDateTimeFormats() method −using System; public class Demo { public static void Main() { DateTime d = new DateTime(2019, 11, 10, 7, 20, 45); string[] res = d.GetDateTimeFormats(); foreach(string s in res) ... Read More

680 Views
The DateTime.FromOADate() method in C# is used to return a DateTime equivalent to the specified OLE Automation Date.SyntaxFollowing is the syntax −public static DateTime FromOADate (double val);Above, Val is the OLE Automation Date value.ExampleLet us now see an example to implement the DateTime.FromOADate() method −using System; public class Demo { public static void Main() { DateTime d1 = DateTime.FromOADate(1.0); Console.WriteLine("DateTime = {0:dd} {0:y}, {0:hh}:{0:mm}:{0:ss} ", d1); } }OutputThis will produce the following output −DateTime = 31 December 1899, 12:00:00ExampleLet us now see another example to implement the DateTime.FromOADate() method −using System; public ... Read More

873 Views
The UInt32 struct represents a 32-bit unsigned integer. The UInt32 value type represents unsigned integers with values ranging from 0 to 4, 294, 967, 295.Let us now see some examples of UInt32 Struct methods −UInt32.CompareTo()The UInt32.CompareTo() method in C# is used to compare the current instance to a specified object or UInt32 and returns an indication of their relative values.SyntaxFollowing is the syntax −public int CompareTo (object val); public int CompareTo (uint val;Above, the value for the 1st syntax is an object to compare. The value for 2nd syntax is an unsigned integer to compare.The return value is 0 if ... Read More

537 Views
The UInt16 struct represents a 16-bit unsigned integer. The UInt16 value type represents unsigned integers with values ranging from 0 to 65535.Let us now see some examples of UInt16 Struct methods −UInt16.CompareTo()The UInt16.CompareTo() method in C# is used to compare the current instance to a specified object or UInt16 and returns an indication of their relative values.SyntaxFollowing is the syntax −public int CompareTo (object val); public int CompareTo (ushort val;Above, the value for the 1st syntax is an object to compare. The value for 2nd syntax is an unsigned integer to compare.The return value is 0 if the current instance ... Read More

1K+ Views
The Match class has static methods and constants for trigonometric, logarithmic and other mathematical functions.The Math class in C# has Math.E and Math.PI fields. Let us see an example of both the fields −Math.EIt is the natural logarithmic base specified by the constant e.SyntaxThe syntax is as follows −public const double E = 2.71828182845905;ExampleLet us now see an example −using System; public class Demo{ public static void Main(){ double d = Math.E; Console.WriteLine("Math.E = " + d); } }OutputThis will produce the following output −Math.E = 2.71828182845905Math.PIThe Math.PI field represents the ratio ... Read More