Karthikeya Boyini has Published 2383 Articles

How to remove an empty string from a list of empty strings in C#?

karthikeya Boyini

karthikeya Boyini

Updated on 22-Jun-2020 09:06:28

878 Views

Firstly, set a list with empty string as elements.List myList = new List() {    " ",    " ",    " " };Now let us remove one empty element using index.myList.RemoveAt(0);Example Live Demousing System; using System.Collections.Generic; using System.Linq; class Program {    static void Main() {       ... Read More

How to find a substring from a string in C#?

karthikeya Boyini

karthikeya Boyini

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

202 Views

Set the stringstring s = "Tom Cruise";Now let’s say you need to find the substring “Tom”, then use the Contains() method.if (s.Contains("Tom") == true) {    Console.WriteLine("Substring found!"); }The following is the code to learn how to find a substring from a string −Example Live Demousing System; public class Demo ... Read More

Lambda Expressions in C#

karthikeya Boyini

karthikeya Boyini

Updated on 22-Jun-2020 08:58:21

445 Views

A lambda expression in C# describes a pattern.Lambda Expressions has the token => in an expression context. This is read as “goes to” operator and used when a lambda expression is declared.Here, we are finding the first occurrence of the element greater than 50 from a list.list.FindIndex(x => x > ... Read More

How to convert a list of characters into a string in C#?

karthikeya Boyini

karthikeya Boyini

Updated on 22-Jun-2020 08:55:42

184 Views

Firstly, set the characters.char[] arr = new char[5]; arr[0] = 'Y'; arr[1] = 'E'; arr[2] = 'S';Now, convert them into string.string res = new string(arr);The following is the complete code to convert a list of characters into a string −Example Live Demousing System; class Program {    static void Main() ... Read More

How to print all the Armstrong Numbers from 1 to 1000 using C#?

karthikeya Boyini

karthikeya Boyini

Updated on 22-Jun-2020 08:35:01

364 Views

To display Armstrong numbers from 1 to 100, firstly use a while loop.Examplewhile (val

What is a managed code in C#?

karthikeya Boyini

karthikeya Boyini

Updated on 22-Jun-2020 08:23:32

278 Views

Managed code is a code whose execution is managed by Common Language Runtime. It gets the managed code and compiles it into machine code. After that, the code is executed.The runtime here i.e. CLR provides automatic memory management, type safety, etc.Managed code is written in high-level languages run on top ... Read More

Checked vs Unchecked Exceptions in C#

karthikeya Boyini

karthikeya Boyini

Updated on 22-Jun-2020 08:21:35

2K+ Views

You can execute statements in C# in checked or unchecked context.In checked, the exception is raised by arithmetic overflow, whereas in unchecked context, arithmetic overflow is ignored.Checked ExceptionsUse the checked keyword to explicitly enable overflow checking for integral-type arithmetic operations and conversions. For this, just set the checked keyword.Overflow checking ... Read More

How can I convert the epoch stored in MySQL table into readable dates?

karthikeya Boyini

karthikeya Boyini

Updated on 22-Jun-2020 08:05:29

87 Views

To illustrate it we are using the following example of a table named ‘vistors’ which have the epoch as follows −mysql> Create table visitors(userid int not null, name varchar(20), epoch int NOT NULL); Query OK, 0 rows affected (0.42 sec) mysql> Insert into visitors Values(1, 'Gaurav', 1358658942); Query OK, ... Read More

VSAT

karthikeya Boyini

karthikeya Boyini

Updated on 22-Jun-2020 07:49:20

3K+ Views

VSATs (Very Small Aperture Terminals) is a two way, lost cost, ground micro station for transmitting data to and from communication satellites. A VSAT has a dish antenna with diameters between 75 cm to 1 m, which is very small in comparison with 10 m diameter of a standard GEO ... Read More

What is the difference between keywords const and readonly in C#?

karthikeya Boyini

karthikeya Boyini

Updated on 22-Jun-2020 07:41:19

293 Views

ConstConstant fields are the fields that cannot be modified. At the time of declaration, you need to assign a value to it.const int a = 5;ReadonlyA Read-only field is initialized at the time of declaration or you can also set it within the constructor.Let us see an example in which ... Read More

Advertisements