George John has Published 1167 Articles

How to calculate power of three using C#?

George John

George John

Updated on 20-Jun-2020 14:13:57

191 Views

For power of 3, se the power as 3 and apply a recursive code like the following snippet −if (p!=0) { return (n * power(n, p - 1)); }Let’s say the number is 5, then the iterations would be −power(5, 3 - 1)); // 25 power (5, 2-1): // 5The ... Read More

Align the last line of the text with CSS

George John

George John

Updated on 20-Jun-2020 13:41:54

267 Views

The text-align-last property is used to align the last line of the text. You can try to run the following code to align the last line of the text with CSSExampleLive Demo                    .mydiv {           ... Read More

What are the differences between class methods and class members in C#?

George John

George John

Updated on 20-Jun-2020 12:52:50

796 Views

A member function i.e. method of a class is a function that has its definition or its prototype within the class definition similar to any other variable. It operates on any object of the class of which it is a member, and has access to all the members of a ... Read More

How to use RemoveAt in C# ArrayList?

George John

George John

Updated on 20-Jun-2020 12:47:41

370 Views

The RemoveAt method in C# is used to remove an element in a list at a position you set.Firstly, set elements in the list −var subjects = new List(); subjects.Add("Physics"); subjects.Add("Chemistry"); subjects.Add("Biology"); subjects.Add("Science");To remove an element, set the index from where you want to eliminate the element. The following is ... Read More

How to concatenate two strings in C#?

George John

George John

Updated on 20-Jun-2020 11:40:10

684 Views

To concatenate two strings, use the String.Concat method.Let’s say you want to concatenate two strings in C#, str1 and str2, then add it as arguments in the Concat method −string str3 = string.Concat(str1, str2);ExampleThe following is the example − Live Demousing System; class Program {    static void Main() { ... Read More

How to define multiline String Literal in C#?

George John

George John

Updated on 20-Jun-2020 11:32:09

921 Views

Let’s say the string is −Welcome User, Kindly wait for the image to loadFor multiline String Literal, firstly set it like the following statement using@ prefix −string str = @"Welcome User, Kindly wait for the image to load";Now let us display the result. The string is a multi-line string now ... Read More

Working with Hashtable and Dictionary in C#

George John

George John

Updated on 20-Jun-2020 11:08:33

304 Views

HashtableHashtable class represents a collection of key-and-value pairs that are organized based on the hash code of the key. It uses the key to access the elements in the collection.Some of the commonly used methods in Hashtable class are −Sr.No.Method & Description1public virtual void Add(object key, object value);Adds an element ... Read More

What are Left Shift and Right Shift Operators (>> and <<) in C#?

George John

George John

Updated on 20-Jun-2020 11:00:02

699 Views

Bitwise Left shift operatorThe left operands value is moved left by the number of bits specified by the right operand.Bitwise Right shift operatorThe left operands value is moved right by the number of bits specified by the right operand.The following is an example showing how to work with Bitwise left ... Read More

How do you find the length of an array in C#?

George John

George John

Updated on 20-Jun-2020 10:48:01

17K+ Views

To find the length of an array, use the Array.Length() method.ExampleLet us see an example − Live Demousing System; class Program {    static void Main(){       int[] arr = new int[10];       // finding length       int arrLength = arr.Length;       Console.WriteLine("Length ... Read More

What is the meaning of “SELECT” statement in MySQL and how can it be used?

George John

George John

Updated on 20-Jun-2020 06:19:49

124 Views

The SELECT command is used to fetch data from the MySQL database. You can use this command at mysql> prompt as well as in any script like PHP.SyntaxHere is generic syntax of SELECT command to fetch data from the MySQL table −SELECT field1, field2, ...fieldN FROM table_name1, table_name2... [WHERE Clause] ... Read More

Advertisements