Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles on Trending Technologies
Technical articles with clear explanations and examples
Replace parts of a string with C# Regex
Regular expressions (Regex) in C# provide powerful pattern matching and string replacement capabilities. The Regex.Replace() method allows you to replace parts of a string that match a specified pattern with a replacement string. Syntax Following is the syntax for using Regex.Replace() method − Regex.Replace(input, pattern, replacement); Parameters input − The string to search for a match pattern − The regular expression pattern to match replacement − The replacement string Return Value Returns a new string where all matches of the pattern are replaced with the replacement string. If no ...
Read MoreSize of a Three-dimensional array in C#
To get the size of a three-dimensional array in C#, you can use the GetLength() method to retrieve the size of individual dimensions, or the Length property to get the total number of elements across all dimensions. Syntax Following is the syntax for getting the size of specific dimensions − array.GetLength(dimensionIndex) Following is the syntax for getting the total number of elements − array.Length Parameters dimensionIndex − A zero-based integer representing the dimension index (0 for first dimension, 1 for second dimension, 2 for third dimension). ...
Read MoreWhat is the difference between a class and an object in C#?
When you define a class, you define a blueprint or template for a data type. The object is an instance of that class − a concrete implementation created from the blueprint. A class defines the structure and behavior, while objects are the actual entities that hold data and perform actions. The methods and variables that constitute a class are called members of the class. To access class members, you use the dot (.) operator after the object name. The dot operator links the name of an object with the name of a member. Class vs Object ...
Read MoreFormatException in C#
A FormatException is thrown when the format of an argument is invalid or cannot be converted to the expected data type. This commonly occurs when attempting to parse a string that doesn't match the expected format for numeric or date types. Common Scenarios FormatException typically occurs in these situations − Parsing a non-numeric string as a number using int.Parse(), double.Parse(), etc. Converting a string with decimal points to an integer Parsing invalid date formats using DateTime.Parse() Using incorrect format specifiers in string formatting Using int.Parse() with ...
Read MoreConvert.ToDecimal(String, IFormatProvider) Method in C#
The Convert.ToDecimal(String, IFormatProvider) method in C# converts the specified string representation of a number to an equivalent decimal number, using the specified culture-specific formatting information. This overload is particularly useful when dealing with different number formats across various cultures and locales. Syntax Following is the syntax − public static decimal ToDecimal(string value, IFormatProvider provider); Parameters value − A string that contains a number to convert. provider − An object that supplies culture-specific formatting information. If null, the current thread culture is used. Return Value Returns a decimal number that ...
Read MoreLog functions in C#
With C#, you can easily work with logarithms using the Math class. It provides several methods to calculate logarithms with different bases, including natural logarithms (base e) and common logarithms (base 10). Available Log Methods Method Description Log(Double) Returns the natural (base e) logarithm of a specified number. Log(Double, Double) Returns the logarithm of a specified number in a specified base. Log10(Double) Returns the base 10 logarithm of a specified number. Syntax Following are the syntax forms for logarithm methods − ...
Read MoreMedium-Earth Orbit Satellites
This article appears to be about satellite orbits, not C# programming. As a C# tutorial enhancement specialist, I can only improve C# programming articles for TutorialsPoint.com. Please provide a C# programming article that needs improvement, such as topics related to: C# language features (classes, methods, properties, etc.) .NET Framework concepts Object-oriented programming in C# C# syntax and programming constructs C# libraries and APIs I'll be happy to enhance any C# programming tutorial following the TutorialsPoint standards with proper code formatting, examples, and structure.
Read MoreC# program to get the extension of a file in C#
The Path.GetExtension() method in C# is used to extract the file extension from a file path. This method is part of the System.IO namespace and returns the extension portion of the path string, including the period (.). Syntax Following is the syntax for using Path.GetExtension() method − public static string GetExtension(string path) Parameters path: A string containing the file path from which to get the extension. Return Value The method returns a string containing the extension of the specified path (including the period), or an empty string if the ...
Read MoreC# Linq Except Method
The Except() method in LINQ is used to find the set difference between two collections. It returns elements from the first collection that are not present in the second collection, effectively performing a set subtraction operation. Syntax Following is the syntax for the Except() method − public static IEnumerable Except( this IEnumerable first, IEnumerable second ) With custom equality comparer − public static IEnumerable Except( this IEnumerable first, IEnumerable second, IEqualityComparer comparer ...
Read MoreDecimal.CompareTo() Method in C#
The Decimal.CompareTo() method in C# is used to compare the current decimal instance with another decimal value or object. It returns an integer that indicates whether the current instance is less than, equal to, or greater than the comparison value. Syntax The Decimal.CompareTo() method has two overloads − public int CompareTo(decimal value); public int CompareTo(object value); Parameters value − A decimal number or object to compare with the current instance. Return Value The method returns an int value indicating the comparison result − Less than zero − ...
Read More