AmitDiwan has Published 10744 Articles

C# String Operators

AmitDiwan

AmitDiwan

Updated on 02-Dec-2019 12:31:22

578 Views

There are two string operators in C#: Equality and Inequality.ExampleLet us see an example of Equality operator − Live Demousing System; public class Demo {    public static void Main() {       string str1 = "Amit";       string str2 = " ";       Console.WriteLine("Is string1 ... Read More

C# Queue.TrimExcess() Method with Examples

AmitDiwan

AmitDiwan

Updated on 02-Dec-2019 12:28:15

300 Views

The Queue.TrimExcess() method in C# is used to set the capacity to the actual number of elements in the Queue, if that number is less than 90 percent of current capacity.Syntaxpublic void TrimExcess ();Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main() {     ... Read More

C# BitConverter.ToString(Byte[]) Method

AmitDiwan

AmitDiwan

Updated on 02-Dec-2019 12:16:46

2K+ Views

The BitConverter.ToString() method in C# is used to convert the numeric value of each element of a specified array of bytes to its equivalent hexadecimal string representation.Syntaxpublic static string ToString (byte[] val);Above, val is the byte array.Example Live Demousing System; public class Demo {    public static void Main() {   ... Read More

Single.Equals() Method in C# with Examples

AmitDiwan

AmitDiwan

Updated on 02-Dec-2019 12:11:42

96 Views

The Single.Equals() method in C# is used to return a value indicating whether two instances of Single represent the same value.Syntaxpublic bool Equals (float ob); public override bool Equals (object ob);The parameter ob for the both the syntaxes is an object to compare with this instance.Example Live Demousing System; public class ... Read More

C# BitConverter.ToChar() Method

AmitDiwan

AmitDiwan

Updated on 02-Dec-2019 12:07:51

190 Views

The BitConverter.ToChar() method in C# is used to returns a Unicode character converted from two bytes at a specified position in a byte array.Syntaxpublic static char ToChar (byte[] value, int begnIndex);Above, val is the byte array, whereas begnIndex is the beginning position within val.Example Live Demousing System; public class Demo { ... Read More

Boolean.GetHashCode() Method in C# with Examples

AmitDiwan

AmitDiwan

Updated on 02-Dec-2019 11:25:31

158 Views

The Boolean.GetHashCode() method in C# is used to return the hash code for this instance.Syntaxpublic override int GetHashCode ();Example Live Demousing System; public class Demo {    public static void Main(String[] args){       string str = "JackSparrow!";       bool val = true;       char[] arr ... Read More

Uri.HexEscape(Char) Method in C#

AmitDiwan

AmitDiwan

Updated on 14-Nov-2019 06:57:07

165 Views

The Uri.HexEscape() method in C# is used to convert a specified character into its hexadecimal equivalent.SyntaxFollowing is the syntax −public static string HexEscape (char ch);Above, the parameter ch is the character to convert to hexadecimal representation.ExampleLet us now see an example to implement the Uri.HexEscape() method −using System; public class ... Read More

UInt32.GetHashCode() Method in C# with Examples

AmitDiwan

AmitDiwan

Updated on 14-Nov-2019 06:56:00

117 Views

The UInt32.GetHashCode() method in C# is used to get the HashCode for the current UInt32 instance.SyntaxFollowing is the syntax −public override int GetHashCode ();ExampleLet us now see an example to implement the UInt32.GetHashCode() method −using System; public class Demo {    public static void Main(){       uint val1 ... Read More

How to change the WindowWidth of the Console in C#?

AmitDiwan

AmitDiwan

Updated on 14-Nov-2019 06:53:59

129 Views

Use the Console.WindowWidth Property to change the WindowWidth of the Console.ExampleLet us now see an example −using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Demo {    public static void Main (string[] args) {       Console.InputEncoding = Encoding.ASCII;       Console.WriteLine("Input Encoding Scheme = ... Read More

How to change the WindowTop of the Console in C#?

AmitDiwan

AmitDiwan

Updated on 14-Nov-2019 06:52:56

139 Views

Use the Console.WindowTop Property to change the WindowTop of the Console in C#.ExampleLet us now see an example −using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Demo {    public static void Main (string[] args) {       Console.InputEncoding = Encoding.ASCII;       Console.WriteLine("Input Encoding ... Read More

Advertisements