C# has a fast and easy-to-implement object serialization into JSON with the help of JsonSerializer.
Read more in articleIn C#, IEnumerable was not designed to be modified so it is best to use List when trying to modify a collection
Read more in articleThis is a step-by-step guild to install Visual Studio. It is a great IDE to work with and has rich features and debugging tools.
Read more in articleIn C#, JsonSerializer Deserialize is the best JSON Deserializer method as it is the fastest based on my testing. It has native C# support.
Read more in articleIn C#, Array Copy is best to use when copying part of an array to another array. It fits on one line and it is fast. Also, it has no limitation on types.
Read more in articleThe best method for combining two arrays into one in C# is Enumerable Concat. It is fast, easy to read, and fits on one line.
Read more in articleIn C#, Enumerable Repeat is the fastest method to fill an array with one value. It is compact and readable a good combination.
Read more in articleThe C# ArraySegment Method is the fastest for slicing an array, with many other good ones to choose from. With a short syntax and has a long framework support.
Read more in articleIn C#, LINQ Distinct is the best method for removing duplicate items from an array. It is the fastest method,and really compact and readably.
Read more in articleIn C#, LINQ Contains provides the fastest method for searching an array for an element match. it is on one line but it is not as flexible as Array Exits.
Read more in articleIn C#, LINQ Any provides a quick and compact syntax for checking if the text contains a keyword from a string array.
Read more in articleIn C#, the static array empty method is the best initializer for an empty array. It does what it says and quick to use by using one step.
Read more in articleThere are 4 main ways to initialize a C# array. One initializes to null or default, array initializers, shorthand and new operator.
Read more in articleA C# string can be converted to a byte array and visa versa. C# provides encoders classes that can do this operation by GetString and GetBytes.
Read more in articleThe Array Indexer is the best way in C# to assign values for the entire array. It's fast, less code and no need to convert between types.
Read more in articleArrays are a fundamental data structure in programming. C# provides a fast, simple and generic array implementation
Read more in articleThere are a couple of ways to have a one-to-many collection type. You can use a dictionary in C# with a List or List of KeyValuePairs. Each with pros and cons.
Read more in articleTryGetValue is the best .NET method for getting values from a dictionary. It performs better and takes up less code than using ContainsKey with Indexer.
Read more in articleA Fix For Collection Was Modified And Enumeration Not Executed comes by copying parts or the whole dictionary in the reader thread.
Read more in articleTo get a list from the dictionary's keys, C# has LINQ's ToList is concise and easy to read, and just as fast as the list constructor.
Read more in articleThere are small differences in creating a C# dictionary in a function, but the Index Initializer has the best performance and easiest-to-read syntax.
Read more in articleIn .NET, to make a dictionary case insensitive it must be done in the declaration. There are three options and OrdinalIgnoreCase is the fastest.
Read more in articleChanging the C# dictionary key is only possible by removing the existing key and adding the new key and existing value. This has the best performance.
Read more in articleMapping two lists into a dictionary is best done manually. It has the best performance and also can handle duplicate keys without throwing exceptions.
Read more in articleThe best way in C# to convert a list to a dictionary is to use the dictionary indexer. It is fast enough, has simple syntax, and works with duplicates.
Read more in articleThe best dictionary merge method is the merge loop method. You can write yourself and it is faster than the C# LINQ methods.
Read more in articleElemenatAt lets a dictionary be accessed by numeric values, but this is far not the best way in C#
Read more in articleC# provides Collection Initializers syntax to initialize dictionaries to simple, quick, and readable code.
Read more in articleIn .NET, Dictionary performs much better than Hashtable. It is a clear example why it is better to use a generic collection type.
Read more in articleIn C#, TryGetValue is best suited for the check if the key exists in the dictionary because it checks then returns the value too.
Read more in articleUsing a LINQ Extension method is the best way to sort a dictionary by value. It is quick and easy to implement.
Read more in articleTryGetValue is the best method in C# for updating a value because it checks if the key exists and retrieves and returns the value to use right away.
Read more in articleThe best way in .NET to get keys by their value from a dictionary is to use the dictionary and list combo. This gives speed and flexibility.
Read more in articleDictionary fastest C# methods are iterating over just the Keys and Values but looping through both Key and Value a list with a class container performs better
Read more in articleIn C#, When comparing List to IEnumerable, List has more functionality but using LINQ with IEnumerable it has better performance than List.
Read more in articleThe fastest C# method for converting a system array to a list is to use an array cast and then use ToList. It is short and compact and easy to read.
Read more in articleThe best methods for intersect, union, and except are with the HashSet collection type. The HashSet functions are faster than LINQs.
Read more in articleThe best C# method for getting unique items from a list is to use a combination of HashSet and List. It has good performance and the order of the items is preserved.
Read more in articleCloning a C# list is a matter of understanding the differences in shallow, and deep copies and the difference between value and reference types.
Read more in articleC# list are the backbone of collections and often the most used. They are versatile and flexible, they increase and decrease the underline array automatically.
Read more in articleStrings are some of the first data types to learn in the csharp so it becomes important to manipulate strings, and to parsing strings
Read more in articleCode snippet is is sections of brief code and explanation that could be useful to you for simple yet fundamental issues that could arise.
Read more in articleThe best C# method for finding an item in a list is the List Find method, however, the best collection type for finding an item in the dictionary.
Read more in articleThe best .NET method to convert a list to a string with a delimiter is the string join method. It is by far the fastest, it is compact, and also easy to set up.
Read more in articleInitializing the C# list using the in-line method is best used when there are only a few items and also where the list won't change much very often.
Read more in articleThe best sorting method in C# is LINQ's order by function. It is the fastest method and it is compact.
Read more in articleThe best way in C# to access an item on a list is to use the Indexer property. It is extremely fast and once used to the syntax, it becomes a go-to property.
Read more in articleThe most effective function for getting a substring between two C# strings is the span slice. Speed is an important factor because that has an impact on the end user.
Read more in articleThe best .NET method for getting the first n characters is span slice. Performance is the best metric to determine which is best because it affects the end users.
Read more in articleThe best way in C# to get the last n characters is to use a string substring. It has one of the fastest methods and is readable so you don't have to guess what it does.
Read more in articleThe overall best way in C# to solve getting a substring after finding a keyword is with Span Slice because of the huge performance gain.
Read more in articleIn C#, Span Slice came at the fastest first character removal method at about half a second while substring, range operator, remove, and trim start were pretty fast.
Read more in articleData can have duplicated and errors can be in the inputs and fields it is important to efficiently remove the first keyword occurrence from a C# string.
Read more in articleGetting a substring before or after a certain character is common in parsing C# strings, user data, database data, and automatic data generated by scripts.
Read more in articleIn C#, String Equals comparing two strings to find out if they are exactly the same. The comparison is case-sensitive and usually used in conditional statements.
Read more in articleIn C#, the method string replace is a string and character substitute with another string. It finds the characters and then replaces them it a new set of characters.
Read more in articleIn C#, string trim removes space, tabs, and various lengths of whitespace at the beginning or end of a string. This is good for user inputs.
Read more in articleString insert puts a single string between a section of the string. The first parameter is an index of insert and the second parameter is the string to insert.
Read more in articleIn C#, String remove takes an existing string and based on the start index and length for removal then will return a string with that section removed.
Read more in articleThe substring method in C# copies a chunks of an existing string. It returns a sub-section of the original string and depends on the selected index range.
Read more in articleIn .NET, Array vs Lists vs Linked Lists is a common collection type, each has pros and cons so it is important to understand these as we make our collection choices.
Read more in articleIn C#, the exception CS1736:Default parameter value must be a compile-time constant comes when assigning an optional parameter value is not a constant or default value.
Read more in articleC# Dictionary using best practices with the right key scales well over large datasets. There are several pitfalls that should be avoided.
Read more in articleOne way to copy files to the output folder is to edit the .csproj file and add a command to copy files from a certain directory into the output folder.
Read more in articleIn .NET, list and dictionary are useful collection types. They are accessible and convenient to use. There are advantages over an array or hash tables.
Read more in articleWant to find out if a DLL or assembly is targeting 32bit or 64bit then Visual Studio comes with a handy tool called Corflags accessed by the command prompt.
Read more in articleHex is a base 16 number system and C# has a built-in function that can convert a string hex value into an int value.
Read more in articleString vs StringBuilder are similar and in most cases in .NET, we will use string but we need a more efficient option in StringBuilder.
Read more in articleWhen testing or writing programs that generate files you may want automate opening the file in code than manually opening those files.
Read more in articleThe new line in .NET is a special sequence that can be inserted into a string. Represented as a backslash n this works as if you pressed return on the keyboard.
Read more in articleGetting a substring before or after a certain character is common in parsing C# strings, user data, database data, and automatic data generated by scripts.
Read more in articleIn C#, the exception CS1736:Default parameter value must be a compile-time constant comes when assigning an optional parameter value is not a constant or default value.
Read more in articleTryGetValue is the best method in C# for updating a value because it checks if the key exists and retrieves and returns the value to use right away.
Read more in articleThe most effective function for getting a substring between two C# strings is the span slice. Speed is an important factor because that has an impact on the end user.
Read more in articleMapping two lists into a dictionary is best done manually. It has the best performance and also can handle duplicate keys without throwing exceptions.
Read more in articleIn .NET, Array vs Lists vs Linked Lists is a common collection type, each has pros and cons so it is important to understand these as we make our collection choices.
Read more in articleDictionary fastest C# methods are iterating over just the Keys and Values but looping through both Key and Value a list with a class container performs better
Read more in articleThe best dictionary merge method is the merge loop method. You can write yourself and it is faster than the C# LINQ methods.
Read more in articleElemenatAt lets a dictionary be accessed by numeric values, but this is far not the best way in C#
Read more in articleChanging the C# dictionary key is only possible by removing the existing key and adding the new key and existing value. This has the best performance.
Read more in articleTryGetValue is the best .NET method for getting values from a dictionary. It performs better and takes up less code than using ContainsKey with Indexer.
Read more in articleC# Dictionary using best practices with the right key scales well over large datasets. There are several pitfalls that should be avoided.
Read more in articleIn C#, TryGetValue is best suited for the check if the key exists in the dictionary because it checks then returns the value too.
Read more in articleThere are 4 main ways to initialize a C# array. One initializes to null or default, array initializers, shorthand and new operator.
Read more in articleThe best C# method for finding an item in a list is the List Find method, however, the best collection type for finding an item in the dictionary.
Read more in articleIn C#, the static array empty method is the best initializer for an empty array. It does what it says and quick to use by using one step.
Read more in articleUsing a LINQ Extension method is the best way to sort a dictionary by value. It is quick and easy to implement.
Read more in articleThis is a step-by-step guild to install Visual Studio. It is a great IDE to work with and has rich features and debugging tools.
Read more in articleThere are a couple of ways to have a one-to-many collection type. You can use a dictionary in C# with a List or List of KeyValuePairs. Each with pros and cons.
Read more in articleIn .NET, to make a dictionary case insensitive it must be done in the declaration. There are three options and OrdinalIgnoreCase is the fastest.
Read more in article