What are strin concatation methods in c#?



What are strin concatation methods in c#?..

Answer / 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

More C Sharp Interview Questions

Are structs value types c#?

0 Answers  


Explain the concepts of cts and cls(common language specification).

0 Answers  


Define method overloading in c#?

0 Answers  


What is the difference between icomparer and icomparable in c#?

0 Answers  


Can you inherit from a static class in c#?

0 Answers  






What is argument in c#?

0 Answers  


What is fcl in c#?

0 Answers  


Are cao stateful in nature?

0 Answers  


What is a multicast delegate in c#?

0 Answers  


How does the XmlSerializer work ?

1 Answers  


Can class be protected in c#?

0 Answers  


What is different between Static Constructor and Private Constructor?

0 Answers  


Categories