Karthikeya Boyini has Published 2193 Articles

C# program to check for a string that contains all vowels

karthikeya Boyini

karthikeya Boyini

Updated on 22-Jun-2020 12:55:59

571 Views

To check for all vowels, firstly set the condition to check −string res = str.Where(chk =< "aeiouAEIOU".Contains(chk)).Distinct();Above, we have used the string −string str = "the quick brown fox jumps over the lazy dog";Now, using the Any() method checks whether the string has any vowels or not −if(!res.Any()) Console.WriteLine("No vowels!");Loop ... Read More

What are the limitations of using MySQL views?

karthikeya Boyini

karthikeya Boyini

Updated on 22-Jun-2020 12:55:02

2K+ Views

In spite of various benefits of using views there are following limitations on using MySQL views − Can’t create an index of views − In MySQL, we cannot create an index on views. It is because indexes are not utilized when we query data against the views. MySQL invalidates the view − ... Read More

How to convert a number from Decimal to Binary using recursion in C#?

karthikeya Boyini

karthikeya Boyini

Updated on 22-Jun-2020 12:54:49

456 Views

To get the binary of Decimal, using recursion, firstly set the decimal number −int dec = 30;Now pass the value to a function −public int displayBinary(int dec) { }Now, check the condition until the decimal value is 0 and using recursion get the mod 2 of the decimal num as ... Read More

How to use string.Empty or String.Empty to initialize a string in C#?

karthikeya Boyini

karthikeya Boyini

Updated on 22-Jun-2020 12:48:03

626 Views

Set the string as empty using the string.Empty in C# −string myStr = string.Empty;To check whether it is a string or not, use the IsNullOrEmpty() method −if (string.IsNullOrEmpty(myStr)) {    Console.WriteLine("String is empty or null!"); }The following is an example −Example Live Demousing System; namespace Demo {    public class ... Read More

Local Inner Class in C#

karthikeya Boyini

karthikeya Boyini

Updated on 22-Jun-2020 12:46:41

1K+ Views

A nested class is a class declared in another enclosing class and it has inner as well as outer class. It is a member of its enclosing class and the members of an enclosing class have no access to members of a nested classLet us see an example code snippet ... Read More

Does declaring an array create an array in C#?

karthikeya Boyini

karthikeya Boyini

Updated on 22-Jun-2020 12:33:45

92 Views

Declaring an array does not initialize the array in the memory. When the array variable is initialized, you can assign values to the array.The following is a declaration and it will not create an array −int[] id;The following create an array of integers. The array is a reference type, so ... Read More

How to obtain Status of the Current Thread in C#?

karthikeya Boyini

karthikeya Boyini

Updated on 22-Jun-2020 12:23:59

222 Views

To get the status of current thread, use the IsAlive() method −Firstly, create a new thread −Thread t = Thread.CurrentThread; t.Name = "Our Thread";Now, to get the status of the current thread −t.IsAliveThe following is the complete code −Example Live Demousing System; using System.Threading; namespace Demo {    class MyClass ... Read More

How to insert an item in ArrayList in C#?

karthikeya Boyini

karthikeya Boyini

Updated on 22-Jun-2020 12:14:40

516 Views

To insert an item in an already created ArrayList, use the Insert() method.Firstly, set elements −ArrayList arr = new ArrayList(); arr.Add(45); arr.Add(78); arr.Add(33);Now, let’s say you need to insert an item at 2nd position. For that, use the Insert() method −// inserting element at 2nd position arr.Insert(1, 90);Let us ... Read More

How to iterate any Map in C#

karthikeya Boyini

karthikeya Boyini

Updated on 22-Jun-2020 12:13:07

2K+ Views

C# has no built-in Math type. For the same, use a Dictionary.Firstly, create a Dictionary −Dictionary d = new Dictionary(); d.Add("keyboard", 1); d.Add("mouse", 2);Get the keys −var val = d.Keys.ToList();Now, use the foreach loop to iterate over the Map −foreach (var key in val) {    Console.WriteLine(key); }To iterate ... Read More

How can we see the information on triggers order in case of multiple triggersfor same event and action time?

karthikeya Boyini

karthikeya Boyini

Updated on 22-Jun-2020 12:12:28

90 Views

It can be done with the help of the following query −mysql> SELECT trigger_name, action_order FROM INFORMATION_SCHEMA.triggers WHERE TRIGGER_SCHEMA = 'query' ORDER BY event_object_table, action_timing, event_manipulation; +------------------------------+--------------+ | trigger_name                 | action_order | +------------------------------+--------------+ | studentdetail_before_update  |            1 ... Read More

Advertisements