What is availWidth Property in JavaScript

Sharon Christine
Updated on 23-Jun-2020 07:54:22

102 Views

Use the screen.availWidth property to return the width of the user’s screen. The result will be in pixels and the Taskbar feature won’t be included.ExampleYou can try to run the following code to learn how to work with the screen.availWidth property in JavaScript −Live Demo                    document.write("Width of the user’s screen: "+screen.availWidth);          

Implicit Conversion from Int32 to Decimal in C#

George John
Updated on 23-Jun-2020 07:54:11

2K+ Views

The int type represents a 32-bit signed integer i.e. Int32.To implicitly convert an Int32 to a Decimal, firstly set a Int32 value.int val = 392;To convert Int32 to decimal, assign the value.decimal d; d = val;Let us see another example.Exampleusing System; public class Demo {    public static void Main() {       int val = 767;       decimal d;       Console.WriteLine("Implicit conversion from Int32 (integer) to Decimal");       d = val;       Console.WriteLine("Decimal : "+dec);    } }

Search String for Text Matching RegExp in JavaScript

Priya Pallavi
Updated on 23-Jun-2020 07:53:50

222 Views

To search a string for a text that matches RegExp, use rhe exec() method in JavaScript. If it finds a match, it returns an array of results; otherwise, it returns null.The following is the parameter −string − The string to be searchedExampleYou can try to run the following code to search a string for text matching RegExp −           JavaScript RegExp exec Method                        var str = "JavaScript is an interesting scripting language";          var re = new RegExp( "script", "g" ); ... Read More

Remove Node at the Beginning of a Linked List in C#

Samual Sam
Updated on 23-Jun-2020 07:53:38

198 Views

To remove a node at the beginning of a LinkedList, use the RemoveFirst() method.string [] employees = {"Peter", "Robert", "John", "Jacob"}; LinkedList list = new LinkedList(employees);Now, to remove the first element, use the RemoveFirst() method.list.RemoveFirst();Let us see the complete example.Example Live Demousing System; using System.Collections.Generic; class Demo {    static void Main() {       string [] employees = {"Peter", "Robert", "John", "Jacob"};       LinkedList list = new LinkedList(employees);       foreach (var emp in list) {          Console.WriteLine(emp);       }       // removing first node       list.RemoveFirst(); ... Read More

Remove Last Element from LinkedList in C#

Ankith Reddy
Updated on 23-Jun-2020 07:53:04

431 Views

Firstly, declare a LinkedList and add nodes.int [] num = {92, 98, 110, 130, 145, 170, 230, 240, 250, 300, 330}; LinkedList myList = new LinkedList(num);Remove the last node from the LinkedList using the RemoveLast() method.myList.RemoveLast();Example Live Demousing System; using System.Collections.Generic; class Demo {    static void Main() {       int [] num = {92, 98, 110, 130, 145, 170, 230, 240, 250, 300, 330};       LinkedList myList = new LinkedList(num);       foreach (var n in myList) {          Console.WriteLine(n);       }       // removing last node       myList.RemoveLast();       Console.WriteLine("LinkedList after removing the last node...");       foreach (var n in myList) {          Console.WriteLine(n);       }    } }Output92 98 110 130 145 170 230 240 250 300 330 LinkedList after removing the last node... 92 98 110 130 145 170 230 240 250 300

Remove Node at the End of a Linked List in C#

karthikeya Boyini
Updated on 23-Jun-2020 07:52:28

179 Views

The following is our LinkedList.string [] employees = {"Patrick", "Robert", "John", "Jacob", "Jamie"}; LinkedList list = new LinkedList(employees);Now, let’s say you need to remove the last node i.e. “Jamie”. For that, use the RemoveLast() method.list.RemoveLast();Example Live Demousing System; using System.Collections.Generic; class Demo {    static void Main() {       string [] employees = {"Patrick", "Robert", "John", "Jacob", "Jamie"};       LinkedList list = new LinkedList(employees);       foreach (var emp in list) {          Console.WriteLine(emp);       }       // removing last node       list.RemoveLast();       Console.WriteLine("LinkedList ... Read More

Year-Month-Y Format Specifier in C#

Arjun Thakur
Updated on 23-Jun-2020 07:51:56

321 Views

The Year Month format specifier represents a custom date and time format string.It is defined by the DateTimeFormatInfo.YearMonthPattern property.Here is the custom format string.yyyy MMMMExample Live Demousing System; using System.Globalization; class Demo {    static void Main() {       DateTime date = new DateTime(2018, 9, 7, 7, 55, 20);       Console.WriteLine(date.ToString("Y",CultureInfo.CreateSpecificCulture("en-US")));    } }OutputSeptember 2018

C# Program to Rename a File

Samual Sam
Updated on 23-Jun-2020 07:51:35

2K+ Views

Use the Move method to rename a file.Let’s say the file name is −D:\tom.txtNow, to update it to the following, use the Move() method.D:\tim.txtLet us see the complete code.Exampleusing System; using System.IO; public class Demo {    public static void Main() {       File.Move(@"D:\tom.txt", @"D:\tim.txt");       Console.WriteLine("File moved successfully!");    } }

Implicit Conversion from 8-bit Signed Integer (sbyte) to Decimal in C#

Chandu yadav
Updated on 23-Jun-2020 07:50:23

267 Views

SByte represents an 8-bit signed integer.To implicitly convert an 8-bit signed integer to a Decimal, firstly set an sbyte value.sbyte val = 51;To convert sbyte to decimal, assign the value.decimal d; d = val;Let us see another example.Exampleusing System; public class Demo {    public static void Main() {       sbyte val = 39;       decimal d;       Console.WriteLine("Implicit conversion from 8-bit signed integer (sbyte) to Decimal");       d = val;       Console.WriteLine("Decimal = "+dec);    } }

Search a Vertical Tab Character Using JavaScript RegExp

Abhinaya
Updated on 23-Jun-2020 07:50:10

278 Views

To find a vertical tab character with JavaScript Regular Expression, use the following −\vExampleYou can try to run the following code to find a vertical tab character. It returns the position where the vertical tab (\v) character is found −           JavaScript Regular Expression                        var myStr = "Secure and \v Responsive!";          var reg = /\v/;          var match = myStr.search(reg);          document.write(match);          

Advertisements