Ankith Reddy has Published 1070 Articles

What is the difference between Trim() and TrimStart() methods in C#?

Ankith Reddy

Ankith Reddy

Updated on 22-Jun-2020 07:36:46

657 Views

TrimA string method that removes all the leading and trailing whitespaces in a string.For example, the string “jack sparrow“ would be returned as the following without leading and whitespaces using trim().jack sparrowThe following is an example −Example Live Demousing System; namespace Demo {    class Program {       static ... Read More

Remove Leading Zeros from a String in C#

Ankith Reddy

Ankith Reddy

Updated on 22-Jun-2020 07:26:30

10K+ Views

Let’s say the following is our string with leading zeros.String str ="000234";Use the TrimStart() method and set the 0 to remove it.TrimStart(new Char[] { '0' } )The following is the complete code to remove leading zeros.Example Live Demousing System; class Program {    static void Main() {       ... Read More

Write a C# program to find GCD and LCM?

Ankith Reddy

Ankith Reddy

Updated on 22-Jun-2020 07:24:03

843 Views

GCD (Greatest Common Divisor)GCD is the largest positive integer that divides each of the integers.LCM (Least Common Multiple)LCM of two numbers is the smallest integer divisible by both the numbers.The following is an example to calculate the GCD and LCM. Here, we are calculating the LCM and GCD of 10 ... Read More

Properties of the Thread Class

Ankith Reddy

Ankith Reddy

Updated on 22-Jun-2020 07:17:04

4K+ Views

A thread is defined as the execution path of a program. Each thread defines a unique flow of control.The following are the properties of the Thread class −Sr.No.Property & Description1CurrentContextGets the current context in which the thread is executing.2CurrentCultureGets or sets the culture for the current thread.3CurrentPrincipleGets or sets the ... Read More

What would be the default return type of MySQL IFNULL() control flow operator?

Ankith Reddy

Ankith Reddy

Updated on 22-Jun-2020 07:00:29

71 Views

Actually, the default return type of IFNULL(expression1, expression2) is more general of the two expressions, in the order STRING, REAL or INTEGER. It can be understood from the following example −Examplemysql> Create table testing Select IFNULL(100, 'testing123'); Query OK, 1 row affected (0.18 sec) Records: 1 Duplicates: 0 Warnings: 0 ... Read More

What is the use of MySQL IS and IS NOT operator?

Ankith Reddy

Ankith Reddy

Updated on 22-Jun-2020 06:41:52

126 Views

In MySQL, both IS and IS NOT operators are used to test a value against a Boolean value.The syntax of IS operator can be as follows −Val IS Boolean_valHere Val is the value that we want to test against Boolean value.Boolean_val is the Boolean value against which the value would be tested and it ... Read More

How can we produce a string, other than default binary string, in a given character set by MySQL CHAR() function?

Ankith Reddy

Ankith Reddy

Updated on 22-Jun-2020 06:07:52

51 Views

We can use the keyword USING to produce a string, other than default binary string, in a given character set. Following result set will demonstrate it −mysql> Select CHARSET(CHAR(85 USING utf8)); +------------------------------+ | CHARSET(CHAR(85 USING utf8)) | +------------------------------+ | utf8                     ... Read More

Set min-width and max-width of an element using CSS

Ankith Reddy

Ankith Reddy

Updated on 22-Jun-2020 05:55:28

447 Views

To set the minimum and maximum width of an element, you can try to run the following codeExampleLive Demo                    div {             max-width: 300px;             min-width: 100px;     ... Read More

How can we find the most recent and most oldest date from a table with the help of MySQL MAX() and MIN() functions?

Ankith Reddy

Ankith Reddy

Updated on 22-Jun-2020 05:27:53

6K+ Views

For getting the most recent date from a table, we need to provide the name of the column, having a date as value, as the argument of MAX() function. Similarly, forgetting the oldest date from a table, we need to provide the name of a column, having a date as ... Read More

How to use MySQL Date functions with WHERE clause?

Ankith Reddy

Ankith Reddy

Updated on 22-Jun-2020 05:02:53

1K+ Views

By using the WHERE clause with any of the MySQL date functions, the query will filter the rows based on the condition provided in the WHERE clause. To understand it, consider the data from ‘Collegedetail’ table as followsmysql> Select * from Collegedetail; +------+---------+------------+ | ID   | Country | Estb ... Read More

Advertisements