Uri.CheckSchemeName(String) Method in C#

AmitDiwan
Updated on 13-Nov-2019 05:42:50

69 Views

The Uri.CheckSchemeName() method in C# is used to determine whether the specified scheme name is valid.syntaxFollowing is the syntax −public static bool CheckSchemeName (string schemeName);Above, the parameter scheme name is the scheme name to validate.ExampleLet us now see an example to implement the Uri.CheckSchemeName() method −using System; public class Demo {    public static void Main(){       Uri newURI = new Uri("https://www.tutorialspoint.com");       Console.WriteLine("URI = "+newURI);       string schemeName = newURI.Scheme;       if(Uri.CheckSchemeName(schemeName))          Console.WriteLine("Valid: Scheme name");       else          Console.WriteLine("Invalid: Scheme name");   ... Read More

Uri.CheckHostName(String) Method in C#

AmitDiwan
Updated on 13-Nov-2019 05:40:50

214 Views

The Uri.CheckHostName() method in C# is used to determine whether the specified hostname is a valid DNS name.SyntaxFollowing is the syntax −public static UriHostNameType CheckHostName (string host_name);ExampleLet us now see an example to implement the Uri.CheckHostName() method −using System; public class Demo {    public static void Main(){       string strURI = "http://localhost";       Console.WriteLine("URI = "+strURI);       UriHostNameType res = Uri.CheckHostName(strURI);       Console.WriteLine("Host type = "+res);    } }OutputThis will produce the following output −URI = http://localhost Host type = UnknownExampleLet us now see another example to implement the Uri.CheckHostName() method ... Read More

UInt64.ToString() Method in C# with Examples

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

323 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 focusout() with Example

AmitDiwan
Updated on 12-Nov-2019 12:50:57

625 Views

The focusout() method in jQuery occurs when an element loses focus.SyntaxThe syntax is as follows −$(selector).focusout(function)ExampleLet us now see an example to implement the jQuery focusout() method −    .demo {       color: blue;    }    $(document).ready(function(){       $("input").focusin(function(){          $("p").html("focusin event triggered");       });       $("input").focusout(function(){          $("p").html("focusout event triggered");       });    }); Student Details Student Name: OutputThis will produce the following output −Now, click inside to get focus −Click outside to lose focus −

jQuery addClass() with Example

AmitDiwan
Updated on 12-Nov-2019 12:48:53

399 Views

The addClass() method in jQuery is used to add one or more class names to the selected elements.ExampleLet us now see an example to implement the jQuery addClass() method −    .demo * {       display: block;       border: 3px dashed red;       padding: 3px;       margin: 25px;    }    .one {       border: 2px solid yellow;    }    $(document).ready(function(){       $("span.test").next().addClass("one");    }); Heading One This is our demo text in div. child grandchild grandchild grandchild ... Read More

jQuery finish() with Example

AmitDiwan
Updated on 12-Nov-2019 12:44:51

117 Views

The finish() method in jQuery is used to stop the currently-running animations. It removes all queued animations and completes all animations for the selected elements.SyntaxThe syntax is as follows −$(selector).finish(queue)Above, the queue parameter is the name of the queue to stop animation.ExampleLet us now see an example to implement the jQuery finish() method −    div {       background:orange;       height:200px;       width:200px;       padding: 5px;    }    $(document).ready(function(){       $("#begin").click(function(){          $("div").animate({height: 450}, 2000);       });   ... Read More

jQuery focusin() with Example

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

126 Views

The focusin() method in jQuery occurs when an element gets focus.SyntaxThe syntax is as follows −$(selector).focusin(function)ExampleLet us now see an example to implement the jQuery focusin() method −    .demo {       color: blue;    } $(document).ready(function(){    $("input").focusin(function(){       $("p").html("focusin event triggered");    });    $("input").focusout(function(){       $("p").html("focusout event triggered");    }); }); Student Details Student Name: OutputThis will produce the following output −Now, click inside to get focus −Click outside to lose focus −

jQuery blur() with Example

AmitDiwan
Updated on 12-Nov-2019 12:38:28

328 Views

The blur() method in jQuery is used to trigger the blur event, whereas the blur event occurs when an element loses focus.SyntaxThe syntax is as follows −$(selector).blur()ExampleLet us now see an example to implement the jQuery blur() method −    .demo {       color: blue;    }    $(document).ready(function(){       $("#btn").click(function(){          $("input").blur();          $("p").html("blur event triggered");       });    }); Student Details Student Name: Student Address: Trigger Event OutputThis will produce the following output −Click on the “Trigger Event” above −

jQuery click() with Example

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

150 Views

The click() method in jQuery is used to initiate the click event or attach a function to run when a click event occurs.SyntaxThe syntax is as follows −$(selector).click(function);ExampleLet us now see an example to implement the jQuery click() method −    $(document).ready(function(){       $(document).ready(function() {          $("p").click(function() {             alert('Paragraph clicked!')          });       });    }); Demo Heading This is a paragraph. OutputThis will produce the following output −Now, click on the paragraph and an alert box will generate −

jQuery focus() with Example

AmitDiwan
Updated on 12-Nov-2019 12:27:02

620 Views

The focus() method in jQuery is used to trigger the focus event. The focus event occurs when an element gets focus.SyntaxThe syntax is as follows −$(selector).focus()ExampleLet us now see an example to implement the jQuery focus() method −    .demo {       color: blue;    }    $(document).ready(function(){       $("#btn").click(function(){          $("input").focus();          $("p").html("focus event triggered");       });    }); Student Details Student Name: Trigger Event OutputThis will produce the following output −Above, click “Trigger Event” to trigger the focus event −

Advertisements