Tag: string

Case insensitive comparison in C#
You can ignore the casing of a string in C# using several methods, each with slightly different nuances. Here's a breakdown with examples:
1. Usin [...]

Escape curly braces in an interpolated string in C#
You escape braces in a C# interpolated string by doubling them. So, { becomes {{ and } becomes }}.
Here's a breakdown and examples:
Why you nee [...]

Building a String Encryption/Decryption Class in C#
How to create a C# class for encrypting and decrypting strings provided by the user. We'll use a simple symmetric encryption method (XOR) for demonst [...]

Difference between String (Uppercase s) and string (lowercase s)
In C#, string (lowercase s) and String (uppercase S) are actually the same thing. They are both aliases for the System.String class, which represents [...]

Create a case insensitive “Contains(string)”
C# is a case sensitive language, and there are occasions where handling strings can be difficult, especially when it relates to casing of the string [...]

Convert date string to DateTime object in C#
Sometimes you will have to deal with dates that come as strings, but you need to convert them to a DateTime object
Let's take the following string [...]

Make text be “typed out” effect in C#
We have a previous article on how to output text in a console slowly, but this article gives code to output word by word, but you might want to output [...]

Return output slowly in C#
There are occasions when we want to give some type of effect to the output we're returning, for example in a game or in the console to make it look li [...]

How to escape braces in a format string in C#
Whenever we're trying to add brackets in a string.Format command we need to escape them, so the problem is that we have
string val = "1,2,3";
A [...]
9 / 9 POSTS