AmitDiwan has Published 11365 Articles

CharEnumerator.GetHashCode() Method in C#

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 11:08:18

24 Views

The CharEnumerator.GetHashCode() method in C# returns a hash code for the current object.Syntaxpublic virtual int GetHashCode ();Let us now see an example to implement the CharEnumerator.GetHashCode() method −Exampleusing System; public class Demo {    public static void Main(){       string strNum = "john";       CharEnumerator ch ... Read More

Dictionary.Count Property in C#

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 11:05:31

288 Views

The Dictionary. Count property in C# gets the number of key/value pairs in the Dictionary.syntaxpublic int Count { get; }Let us now see an example to implement the Dictionary. Count property −Exampleusing System; using System.Collections.Generic; public class Demo {    public static void Main(){       Dictionary dict = ... Read More

How do I return multiple results in a MySQL subquery with IN()?

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 10:59:21

271 Views

In MySQL, you can easily return multiple results, but also achieve this with subquery using IN(). Let us first create a table −mysql> create table DemoTable1317 -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> Name varchar(20) -> ); Query OK, 0 rows affected (0.49 sec)Insert some records ... Read More

Char.TryParse() Method in C#

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 10:59:21

279 Views

The Char.TryParse() method in C# is used to convert the value of the specified string to its equivalent Unicode character.Syntaxpublic static bool TryParse (string str, out char res);Let us now see an example to implement the Char.TryParse () method −Exampleusing System; public class Demo {    public static void Main(){ ... Read More

Char.ToUpperInvariant(Char) Method in C#

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 10:57:49

128 Views

The Char.ToUpperInvariant() method in C# is used to convert the value of a Unicode character to its uppercase equivalent using the casing rules of the invariant culture.Syntaxpublic static char ToUpperInvariant (char ch);Above, the parameter ch is the Unicode character to convert.Let us now see an example to implement the Char.ToUpperInvariant() ... Read More

Select words from a text already in a MySQL table

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 10:56:56

228 Views

Let us first create a table −mysql> create table DemoTable1316 -> ( -> Value varchar(40) -> ); Query OK, 0 rows affected (0.47 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1316 values('MySQL'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable1316 values('Java'); Query ... Read More

Math.Log10() Method in C#

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 10:55:43

251 Views

The Math.Log10() method in C# is returned to the base 10 logarithms of a specified number.Syntaxpublic static double Log10 (double val);Here, Val is the number whose logarithm we want.The Log10() method returns −Val parameterReturnsPositiveThe base 10 log of d; that is, log 10d.ZeroNegativeInfinityNegativeNaNEqual to NaNNaNEqual to PositiveInfinityPositiveInfinityLet us now see ... Read More

MySQL query to convert empty values to NULL?

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 10:55:35

845 Views

It’s easy to convert empty values to NULL using SET and WHERE. Let us first create a table −mysql> create table DemoTable1315 -> ( -> CountryName varchar(10) -> ); Query OK, 0 rows affected (0.60 sec)Insert some records in the table using insert command. We have set some empty values ... Read More

Math.Log() Method in C#

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 10:52:30

522 Views

The Math.Log() method in C# is used to return the logarithm of a specified number.Syntaxpublic static double Log(double num) public static double Log(double num, double base)Above, num is the specified number whose logarithm is to be calculated. Here, the base is the base of the logarithm.Let us now see an ... Read More

MySQL query to display records ordered by numeric difference?

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 10:46:31

51 Views

Use ORDER BY and set the difference to display records ordered by numeric difference. Following is the syntax −select *from yourTableName order by (yourIntegerColumnName1 - yourIntegerColumnName2);Let us first create a table −mysql> create table DemoTable1313 -> ( -> Name varchar(20), -> Score1 int, -> Score2 int -> ); Query OK, ... Read More

Advertisements