George John has Published 1081 Articles

Transform the element by using 16 values of matrix with CSS3

George John

George John

Updated on 22-Jun-2020 14:57:42

230 Views

Use the matrix3d(n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n) method to transform the element using 16 values of matrix.Let us see the syntaxmatrix3d(a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4)Here,  a1 b1 c1 ... Read More

C# Program to match all the digits in a string

George John

George John

Updated on 22-Jun-2020 14:53:57

380 Views

To match all digits in a string, use C# Regex.Firstly, set a string with digits −string str = "These are my marks: 90 out of 100!";Use the following regular expression to get digits in a string −@"\d+"The following is the code −Example Live Demousing System; using System.Text.RegularExpressions; namespace Demo {   ... Read More

CSS position: fixed;

George John

George John

Updated on 22-Jun-2020 14:51:03

473 Views

The position: fixed; property allows you to position element relative to the viewport. You can try to run the following code to implement CSS position: fixed;ExampleLive Demo                    div{             position: fixed;       ... Read More

Any Extension method in C#

George John

George John

Updated on 22-Jun-2020 14:47:54

483 Views

The Any() extension method is part of the System.Linq namepspace. Using this method, you can check whether any of the elements matches a certain condition or not.Firstly, set an array with elements −int[] arr = { 6, 7, 15, 40, 55 };The following is an example. It checks whether any ... Read More

Tuple.Create method in C#

George John

George John

Updated on 22-Jun-2020 14:45:08

124 Views

To create a tuple, use the Tuple.Create method.Here we have set a tuple with a string and int −var myTuple = Tuple.Create("marks", 100);The following is an example that creates a tuple using Tuple.Create and displays the elements in a single line in C# −Example Live Demousing System; class Demo {   ... Read More

C# Program to get the name of root directory

George John

George John

Updated on 22-Jun-2020 14:33:02

631 Views

Use the RootDirectory property to get the name of the root directory.Firstly, use DriveInfo to set the drive for which you want the root directory −DriveInfo dInfo = new DriveInfo("C");Now, the RootDirectory gives you the result −dInfo.RootDirectoryExampleHere is the complete code −using System; using System.Linq; using System.IO; public class Demo ... Read More

Aggregate method in C#

George John

George John

Updated on 22-Jun-2020 14:30:53

1K+ Views

Use the Aggregate method in C# to perform mathematical operations such as Sum, Min, Max, Average, etc.Let us see an example to multiply array elements using Aggregate method.Here is our array −int[] arr = { 10, 15, 20 };Now, use Aggregate() method −arr.Aggregate((x, y) => x * y);Here is the ... Read More

C# orderby Keyword

George John

George John

Updated on 22-Jun-2020 14:26:38

202 Views

Use the orderby leyword to sort a list in ascending or descending order.The following is the list −List myList = new List(); myList.Add("truck"); myList.Add("bus"); myList.Add("bicycle"); myList.Add("motorbike");Now let us sort the list in descending order −myLen = from element in myList orderby element.Length descending select element;Here is the complete code −Example Live ... Read More

Stopwatch class in C#

George John

George John

Updated on 22-Jun-2020 14:19:14

2K+ Views

Stopwatch is a class in C# to measure the elapsed time. Use it to calculate the time a function took to execute. It is found under System.Diagnostics.To get the elapsed time, firstly begin the Stopwatch −var sw = Stopwatch.StartNew();For elapsed ticks −long ticks = sw.ElapsedTicks;Let us see an example −Example Live ... Read More

Ulong type in C#

George John

George John

Updated on 22-Jun-2020 14:17:34

829 Views

The Ulong type in C# is an alias to the System.UInt64 type. It is an Unsigned integer.Set the Ulong type −ulong val = 7712059531;To get the minimum and maximum value for Ulong type −Console.WriteLine(ulong.MaxValue); Console.WriteLine(ulong.MinValue);Here is the complete code −Example Live Demousing System; using System.Threading; using System.Diagnostics; public class Demo { ... Read More

Advertisements