Karthikeya Boyini has Published 2193 Articles

How to convert Lower case to Upper Case using C#?

karthikeya Boyini

karthikeya Boyini

Updated on 21-Jun-2020 12:53:47

2K+ Views

To convert Lower case to Upper case, use the ToUpper() method in C#.Let’s say your string is −str = "david";To convert the above lowercase string in uppercase, use the ToUpper() method −Console.WriteLine("Converted to UpperCase : {0}", str.ToUpper());The following is the code in C# to convert character case −Exampleusing System; using ... Read More

User-defined Exceptions in C# with Example

karthikeya Boyini

karthikeya Boyini

Updated on 21-Jun-2020 12:52:40

5K+ Views

An exception is a problem that arises during the execution of a program. A C# exception is a response to an exceptional circumstance that arises while a program is running, such as an attempt to divide by zero.Define your own exception. User-defined exception classes are derived from the Exception class.The ... Read More

What is a sealed class in C#?

karthikeya Boyini

karthikeya Boyini

Updated on 21-Jun-2020 12:48:54

791 Views

Sealed class in C# with the sealed keyword cannot be inherited. In the same way, the sealed keyword can be added to the method.When you use sealed modifiers in C# on a method, then the method loses its capabilities of overriding. The sealed method should be part of a derived ... Read More

Listing out directories and files using C#

karthikeya Boyini

karthikeya Boyini

Updated on 21-Jun-2020 12:41:57

522 Views

The Directory class in C# has many methods to perform operations on directories and sub-directories −Sr.NoMethod & Description1CreateDirectory(String)Creates all directories and subdirectories in the specified path unless they already exist.2CreateDirectoryDirectorySecurity(String)Creates all the directories in the specified path, unless the already exist, applying the specified Windows security.3Delete(String)Deletes an empty directory from ... Read More

Mathematical Functions in C#

karthikeya Boyini

karthikeya Boyini

Updated on 21-Jun-2020 12:41:40

2K+ Views

The System.Math class in C# provides methods are properties to perform mathematical operations, trigonometric, logarithmic calculations, etc.Some of its methods include −Sr.NoMethod & Description1Abs(Decimal)Returns the absolute value of a Decimal number.2Abs(Double)Returns the absolute value of a double-precision floating-point number.3Abs(Int16)Returns the absolute value of a 16-bit signed integer.4Abs(Int32)Returns the absolute value ... Read More

Math class methods in C#

karthikeya Boyini

karthikeya Boyini

Updated on 21-Jun-2020 12:33:38

561 Views

The System.Math class in C# provides methods are properties to perform mathematical operations, trigonometric, logarithmic calculations, etc.Some of its methods include −Sr.NoMethod & Description1Abs(Decimal)Returns the absolute value of a Decimal number.2Abs(Double)Returns the absolute value of a double-precision floating-point number.3Abs(Int16)Returns the absolute value of a 16-bit signed integer.4Abs(Int32)Returns the absolute value ... Read More

What are the rules for naming classes in C#?

karthikeya Boyini

karthikeya Boyini

Updated on 21-Jun-2020 12:28:25

482 Views

A class definition starts with the keyword class followed by the class name; and the class body enclosed by a pair of curly braces.The following is the syntax − class class_name {    // member variables     variable1;     variable2;    ...     variableN; ... Read More

What is the octal equivalent of a decimal number in C#?

karthikeya Boyini

karthikeya Boyini

Updated on 21-Jun-2020 12:14:46

199 Views

To get the octal equivalent of a decimal in C# −Firstly, for the decimal value use a while loop and store the remainder in the array set for octal. Here we found the mod 8 of them in the array.After that, divide the number by 8 −while (dec != 0) ... Read More

What are the escape sequences supported by C#?

karthikeya Boyini

karthikeya Boyini

Updated on 21-Jun-2020 12:06:35

178 Views

The following is an example showing how to display some of the escape characters in C# −Exampleusing System; using System.Collections.Generic; class Demo {    static void Main() {       Console.WriteLine("Warning!" + '\u0007');       Console.WriteLine("Test \t Demo Text");       Console.WriteLine("This is ... Read More

What are punctuators in C#?

karthikeya Boyini

karthikeya Boyini

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

596 Views

Punctuators are used in C# as special symbols to a group or divide the code. It includes −] () {}, ; * = #For example, = gets included in a class or even while declaring a variable. Statement ends with a semi-colon −int a = 10;In a class, the braces ... Read More

Advertisements