How to compare two dates in c#

{2 Comments}

When there is comparison of two date time data types or just say two dates. Their must be two result we are trying to find first one is to check the date are equal or not, in other case we want to check which date is greater or smaller. In below article there are two …

Read More…

How to compare two strings in c#

{0 Comments}

To compare two strings in csharp there are various such method which compare them in different manner according to the developer’s condition such as having same string,  same string with different ordinals (uppercase or lowercase), starting and ending of strings value etc. the major types of comparison methods or function present in .Net framework 4.5 …

Read More…

How to convert string to byte array in c#

{0 Comments}

To convert string to byte array in c# we use GetBytes() method here we pass string as parameter and it return converted byte array of given string you can use following syntax to convert string to byte array. To use get byte method you need to first include system.text namespace.   C# |  copy code |? 1byte[] array = Encoding.ASCII.GetBytes(input);

Read More…

How to convert string to int/integer in c#

{0 Comments}

As most of the conversion is handled by the convert class of the system, in this scenario we will use the same convert class for converting the string data type to an integer data type. Here (To int 32) is the associative method of convert class which we can use to convert the string to …

Read More…

How to convert a string to datetime in c#

{0 Comments}

When we have date as a form of string and we want to convert them in Date Time format. Then we can use system’s convert class to convert which is most widely used to convert many values data type. The associated ToDateTime method is then used to convert the string date value to DateTime data …

Read More…

How to break a string in c#

{0 Comments}

To break string in Csharp we use split inbuilt function or method. We split the string on the basis of delimiter. In below code sample uses the space delimiter, that is found most in any string statement you can use other delimiter in place of space. Split function return result as an array so we …

Read More…

How to append string in c#

{0 Comments}

There is no any function or method to append strings in Csharp language, but string can be appended after another existing string. In this article you will get to know how we can append string after other string in csharp language. We usually use plus operator to append a string to other existing string. So …

Read More…

How to add days to date in c#

{0 Comments}

To add a day to existed date, we can use Adddays inbuilt function in C#. it associated with the date time data type.  Call the function after dot and pass number of the days as a parameter in the add days function. Following is the code samples to understand the use of add days function. …

Read More…