AmitDiwan has Published 10740 Articles

Thread.CurrentThread Property in C#

AmitDiwan

AmitDiwan

Updated on 03-Dec-2019 12:45:33

297 Views

The Thread.CurrentThread propertyin C# is used to get the currently running thread.SyntaxThe syntax is as follows -public static System.Threading.Thread CurrentThread { get; }ExampleLet us now see an example - Live Demousing System; using System.Threading; public class Demo {    public static void Main() {       Thread thread = new ... Read More

C# String Properties

AmitDiwan

AmitDiwan

Updated on 03-Dec-2019 12:40:51

895 Views

Following are the properties of the String class in C# −Sr.NoProperty & Description1CharsGets the Char object at a specified position in the current String object.2LengthGets the number of characters in the current String object.ExampleLet us see an example - Live Demousing System; public class Demo {    public static void Main() ... Read More

C# String.ToUpperInvariant Method

AmitDiwan

AmitDiwan

Updated on 03-Dec-2019 12:31:04

1K+ Views

The String.ToUpperInvariant() method in C# is used to return a copy of this String object converted to uppercase using the casing rules of the invariant culture.SyntaxThe syntax is as follows -public string ToUpperInvariant ();ExampleLet us now see an example - Live Demousing System; using System.Text; public class Demo {    public ... Read More

C# String.ToLowerInvariant Method

AmitDiwan

AmitDiwan

Updated on 03-Dec-2019 12:18:20

1K+ Views

The String.ToLowerInvariant() method in C# is used to return a copy of this String object converted to lowercase using the casing rules of the invariant culture.SyntaxThe syntax is as follows -public string ToLowerInvariant ();ExampleLet us now see an example - Live Demousing System; using System.Text; public class Demo {    public ... Read More

TimeSpan.FromTicks() Method in C#

AmitDiwan

AmitDiwan

Updated on 03-Dec-2019 12:14:14

390 Views

The TimeSpan.FromTicks() method in C# is used to return a TimeSpan that represents a specified time, where the specification is in units of ticks.SyntaxThe syntax is as follows -public static TimeSpan FromTicks (long val);Above, the parameter val is the number of ticks that represent a time.ExampleLet us now see an ... Read More

C# Object.GetHashCode() Method with Examples

AmitDiwan

AmitDiwan

Updated on 03-Dec-2019 12:10:56

1K+ Views

The Object.GetHashCode() method in C# is used to serve as the default hash function.Syntaxpublic virtual int GetHashCode ();ExampleLet us now see an example - Live Demousing System; public class Demo {    public static void Main() {       Object ob = new Object();       String str = ... Read More

C# IsNullOrWhiteSpace() Method

AmitDiwan

AmitDiwan

Updated on 03-Dec-2019 12:06:56

335 Views

The IsNullOrWhiteSpace() method in C# is used to indicate whether a specified string is null, empty, or consists only of white-space characters.Syntaxpublic static bool IsNullOrWhiteSpace (string val);Above, the parameter val is the string to test. Let us now see an example −ExampleLet us now see an example: Live Demousing System; public ... Read More

C# BitConverter.ToUInt16() Method

AmitDiwan

AmitDiwan

Updated on 03-Dec-2019 12:03:46

398 Views

The BitConverter.ToUInt16() method in C# is used to return a 16-bit unsigned integer converted from two bytes at a specified position in a byte array.Syntaxpublic static ushort ToUInt16 (byte[] val, int begnIndex);Above, val is the byte array, whereas begnIndex is the beginning position within val.ExampleLet us now see an example ... Read More

TimeSpan.FromSeconds() Method in C#

AmitDiwan

AmitDiwan

Updated on 03-Dec-2019 11:57:05

4K+ Views

The TimeSpan.FromSeconds() method in C# is used to return a TimeSpan that represents a specified number of seconds, where the specification is accurate to the nearest millisecond.SyntaxThe syntax is as follows -public static TimeSpan FromSeconds (double val);Above, the parameter val is the number of seconds, accurate to the nearest millisecond.ExampleLet ... Read More

TimeSpan.FromMinutes() Method in C#

AmitDiwan

AmitDiwan

Updated on 03-Dec-2019 11:51:18

2K+ Views

The TimeSpan.FromMinutes() method in C# is used to return a TimeSpan that represents a specified number of minutes, where the specification is accurate to the nearest millisecond.Syntaxpublic static TimeSpan FromMinutes (double val);Above, the value val is the number of minutes, accurate to the nearest millisecond.Example Live Demousing System; public class Demo ... Read More

Advertisements