Found 2587 Articles for Csharp

UInt64.ToString() Method in C# with Examples

AmitDiwan
Updated on 13-Nov-2019 05:39:06

489 Views

The UInt64.ToString() method in C# is used to convert the numeric value of the current UInt64 instance to its equivalent string representation.SyntaxFollowing is the syntax −public override string ToString();ExampleLet us now see an example to implement the UInt64.ToString() method −using System; public class Demo {    public static void Main(){       ulong val1 = 465656665;       ulong val2 = 232525678;       Console.WriteLine("Value1 (String representation) = "+val1.ToString());       Console.WriteLine("Value2 (String representation) = "+val2.ToString());       bool res = val1.Equals(val2);       Console.WriteLine("Return value (comparison) = "+res);       if (res) ... Read More

jQuery closest() with Example

AmitDiwan
Updated on 12-Nov-2019 11:42:48

331 Views

The closest() method in jQuery is used to return the first ancestor of the selected element.SyntaxThe syntax is as follows −$(selector).closest(filter)ExampleLet us now see an example to implement the jQuery closest() method −    .demo * {       display: block;       border: 2px solid blue;       padding: 5px;       margin: 15px;    }    $(document).ready(function(){       $("span").closest("ol").css({"background-color": "orange", "color": "black","border": "3px dashed orange"});    }); body ol ol ol li span OutputThis will produce the following output −

jQuery fadeIn() Method

AmitDiwan
Updated on 12-Nov-2019 11:40:12

331 Views

The fadeIn() method in jQuery is used to change the opacity, for selected elements, from hidden to visible.SyntaxThe syntax is as follows −$(selector).fadeIn(speed, easing, callback)ExampleAbove, speed is the speed of the fading effect. The easing can be swing or linear for speed at different animation points. Callback is the function to be executed after the method gets finished.Let us now see an example to implement the jQuery fadeIn() method −    $(document).ready(function(){       $(".btnout").click(function(){          $("div").fadeOut();       });       $(".btnin").click(function(){          $("div").fadeIn();     ... Read More

UInt64.MinValue Field in C# with Examples

AmitDiwan
Updated on 12-Nov-2019 10:37:40

116 Views

The UInt64.MinValue field in C# represents the minimum value of the 64-bit unsigned integer.SyntaxFollowing is the syntax −public const ulong MinValue = 0;ExampleLet us now see an example to implement the UInt64.MinValue field −using System; public class Demo {    public static void Main(){       ulong val1 = 879879879;       ulong val2 = 464556565;       Console.WriteLine("Value1 = "+val1);       Console.WriteLine("Value2 = "+val2);       Console.WriteLine("HashCode for value1 = "+val1.GetHashCode());       Console.WriteLine("HashCode for value2 = "+val2.GetHashCode());       Console.WriteLine("Are they equal? = "+(val1.Equals(val2)));       TypeCode type1 = ... Read More

UInt64.MaxValue Field in C# with Examples

AmitDiwan
Updated on 12-Nov-2019 10:34:39

195 Views

The UInt64.MaxValue field in C# represents the maximum value of the 64-bit unsigned integer.SyntaxFollowing is the syntax −public const ulong MaxValue = 18446744073709551615;ExampleLet us now see an example to implement the UInt64.MaxValue field −using System; public class Demo {    public static void Main(){       ulong val1 = 879879879;       ulong val2 = 464556565;       Console.WriteLine("Value1 = "+val1);       Console.WriteLine("Value2 = "+val2);       Console.WriteLine("HashCode for value1 = "+val1.GetHashCode());       Console.WriteLine("HashCode for value2 = "+val2.GetHashCode());       Console.WriteLine("Are they equal? = "+(val1.Equals(val2)));       TypeCode type1 = ... Read More

Decimal.ToInt64() Method in C#

AmitDiwan
Updated on 12-Nov-2019 10:30:37

148 Views

The Decimal.ToInt64() method in C# is used to convert the value of the specified Decimal to the equivalent 64-bit signed integer.SyntaxFollowing is the syntax −public static long ToInt64 (decimal val);Above, Val is the decimal number to convert.ExampleLet us now see an example to implement the Decimal.ToInt64() method −using System; public class Demo {    public static void Main(){       Decimal val1 = -567.7989m;       Decimal val2 = 456.000m;       Console.WriteLine("Decimal 1 = "+val1);       Console.WriteLine("Decimal 2 = "+val2);       long res1 = Decimal.ToInt64(val1);       long res2 = Decimal.ToInt64(val2); ... Read More

Decimal.ToInt32() Method in C#

AmitDiwan
Updated on 12-Nov-2019 10:28:34

105 Views

The Decimal.ToInt32() method in C# is used to convert the value of the specified Decimal to the equivalent 32-bit signed integer.SyntaxFollowing is the syntax −public static int ToInt32 (decimal val);Above, Val is the decimal number to convert.ExampleLet us now see an example to implement the Decimal.ToInt32() method −using System; public class Demo {    public static void Main(){       Decimal val1 = 0.001m;       Decimal val2 = 1.000m;       Console.WriteLine("Decimal 1 = "+val1);       Console.WriteLine("Decimal 2 = "+val2);       int res1 = Decimal.ToInt32(val1);       int res2 = Decimal.ToInt32(val2); ... Read More

Char.IsLowSurrogate(String, Int32) Method in C#

AmitDiwan
Updated on 12-Nov-2019 10:26:51

107 Views

The Char.IsLowSurrogate() method in C# indicates whether the Char object at the specified position in a string is a low surrogate.SyntaxFollowing is the syntax −public static bool IsLowSurrogate (string str, int index);Above, str is a string, whereas the index is the position of the character to evaluate in str.ExampleLet us now see an example to implement the Char.IsLowSurrogate() method −using System; public class Demo {    public static void Main(){       string str = new String(new char[] { 'k', 'm', 'g', 't', 'j', 'p', '\uDC00' });       bool res = Char.IsLowSurrogate(str, 6);       if ... Read More

Char.IsLower() Method in C#

AmitDiwan
Updated on 12-Nov-2019 10:25:13

307 Views

The Char.IsLower() method in C# is used to indicate whether the specified Unicode character is categorized as a lowercase letter.SyntaxFollowing is the syntax −public static bool IsLower (char ch);Above, the parameter ch is the Unicode character to evaluate.ExampleLet us now see an example to implement the Char.IsLower() method −using System; public class Demo {    public static void Main(){       bool res;       char val = 'K';       Console.WriteLine("Value = "+val);       res = Char.IsLower(val);       Console.WriteLine("Is the value a lowercase letter? = "+res);    } }OutputThis will produce the ... Read More

Char.IsLetterOrDigit() Method in C#

AmitDiwan
Updated on 12-Nov-2019 10:23:35

827 Views

The Char.IsLetterOrDigit() method in C# indicates whether the specified Unicode character is categorized as a letter or a decimal digit.SyntaxFollowing is the syntax −public static bool IsLetterOrDigit (char ch);Above, ch is the Unicode character to evaluate.ExampleLet us now see an example to implement the Char.IsLetterOrDigit() method −using System; public class Demo {    public static void Main(){       bool res;       char val = '1';       Console.WriteLine("Value = "+val);       res = Char.IsLetterOrDigit(val);       Console.WriteLine("Is the value a letter or digit? = "+res);    } }OutputThis will produce the following ... Read More

Advertisements