What are strin concatation methods in c#?
Answer Posted / kishoreg
Generally in c# strings were concatinated with symbol '+'
1)'+'
string myName;
myName='GVK' + 'kishore';
2)Append
If it is StringBuilder then we can join as below
StringBuilderObject.Append('GVK');
StringBuilderObject.Append('kishore');
3)Join
Join takes a String array and a separator string and
produces a single string with one separator between each
element in the array.Split does the opposite, splitting a
string made up of several elements separated by a
separator.
Ex. string commatext = "alpha,bravo,charlie";
string[] words = commatext.Split(',');
string dashed = string.Join("---", words);
MessageBox.Show(dashed);
Hope helpfull...KishoreG
Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
Enlist all the components of an ado.net framework?
Can delegates be used as callbacks?
What is iqueryable?
What is a collection class in c#?
List down the reason behind the usage of c# language.
Explain jagged arrays in c#?
What is the difference between ref and out parameters in c#?
How to put assembly in gac?
What is the difference between ienumerable and enumerable?
What is session c#?
What is default boolean value in c#?
Explain the Different types of configuration files in .net?
What is the difference between public, static, and void?
What is default value of decimal c#?
What's the difference between System.String and System..StringBuilder in C#?