Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Articles on Trending Technologies
Technical articles with clear explanations and examples
C# program to convert an array to an ordinary list with the same items
Set an array −int[] arr = { 23, 66, 96, 110 };Now, create a new list −var list = new List();Use the Add method and add the array elements to the list −for (int i = 0; i < arr.Length; i++) { list.Add(arr[i]); }The following is the complete code −Exampleusing System; using System.Collections.Generic; public class Program { public static void Main() { int[] arr = { 23, 66, 96, 110 }; var list = new List(); for (int i = 0; i < arr.Length; i++) { list.Add(arr[i]); } foreach(int res in list) { Console.WriteLine(res); } } }Output23 66 96 110
Read Moresr-only Bootstrap class
Hide an element to all devices except screen readers with the class .sr-only.You can try to run the following code to implement the sr-only Bootstrap −Example Bootstrap Example Email address Password
Read MoreBootstrap 4 Button .btn-outline-dark class
Use the .btn-outline-dark class in Bootstrap to set dark outline on a button.The following is an example of a button with dark outline −Set the above outline to the button, using the btn-outline-dark class as shown below − Submit You can try to run the following code to implement the btn-outline-dark class −Example Bootstrap Example Bootstrap 4 Learning btn-outline-dark class usage: Submit
Read MoreHow to calculate Power of a number using recursion in C#?
To calculate power of a number using recursion, try the following code.Here, if the power is not equal to 0, then the function call occurs which is eventually recursion −if (p!=0) { return (n * power(n, p - 1)); }Above, n is the number itself and the power reduces on every iteration as shown below −Exampleusing System; using System.IO; public class Demo { public static void Main(string[] args) { int n = 5; int p = 2; long res; res = power(n, p); Console.WriteLine(res); } static long power (int n, int p) { if (p!=0) { return (n * power(n, p - 1)); } return 1; } }Output25
Read MoreWhat is abstraction in C#?
Abstraction and encapsulation are related features in object-oriented programming. Abstraction allows making relevant information visible and encapsulation enables a programmer to implement the desired level of abstraction.Abstraction can be achieved using abstract classes in C#. C# allows you to create abstract classes that are used to provide a partial class implementation of an interface. Implementation is completed when a derived class inherits from it. Abstract classes contain abstract methods, which are implemented by the derived class. The derived classes have more specialized functionality.The following are some of the key points −You cannot create an instance of an abstract classYou cannot ...
Read MoreCreate a padded grey box with rounded corners in Bootstrap
Use the .jumbotron class to create a padded grey box with rounded corners.You can try to run the following code to implement .jumbotron class in Bootstrap.Example Bootstrap Example Welcome to my website. This is demo text. More
Read MoreBootstrap .modal("toggle") method
Use the .modal(“toggle”) method in Bootstrap to toggle the modal.As shown below, the modal generates on the click of a button −$(document).ready(function(){ $("#button1").click(function(){ $("#newModal").modal("toggle"); }); });Here is the button used above − Modal One You can try to run the following code to implement the modal(“toggle”) method −Example Bootstrap Example Sample Modal One × Sample Modal Click outside to close it. Close $(document).ready(function(){ $("#button1").click(function(){ $("#newModal").modal("toggle"); }); });
Read MoreBootstrap class pull-right
Float an element to the right with class pull-right.You can try to run the following code to implement the pull-right classExample Bootstrap Example Float to right
Read MoreAdd Red label with Bootstrap
Use .label-danger class in Bootstrap to add red colored label.You can try to run the following code to implement the .label-danger class −Example Bootstrap Example If you find any issues, click below Danger
Read MoreContainer to create a grid of Bootstrap 4 cards like a group
To set a container for Bootstrap card and set it like a group, use the card-group class.Use it and create a grid like the following with two Bootstrap cards − Demo Text! Warning! The following is an example to create a grid (group of cards) in Bootstrap −Example Bootstrap Example Group of Messages Demo Text! Warning! Well done! Selected!
Read More