Concatenate Char to String in C#

Hi Programmers, Welcome to Ozanecare. The new article for c# developer to learn how to concatenate Char with String. we can combine characters to strings with or without any method.Let’s see all coding.

1.Concatenating char to string by declaring String datatype variable and Character type variable. we can easily combine with plus(+) operator. see below image.

2.We can concatenate char to string by using StringBuilder class and Append Method. s1 is the object of StringBuilder class , by using ToString method it converts into string and merge with str variable.
see below image.

3.We can concatenate char to string by using StringBuilder class and Append Method. s1 is the object of StringBuilder class. After StringBuilder class using dot(.) operator. The dot(.) operator is used to call Append method and by using ToString method it converts into string and merge with str variable.
see below image.

Happy coding…thanks.

Post Author: adama