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

What is a Jagged Array in C#?

0 Answers   Arigo Infotech,


What is inheritance c#?

0 Answers  


Can namespace contain the private class?

0 Answers  


What do you mean by a windows process in regards to memory allocation?

0 Answers  


what is CSharp

6 Answers  






What is the use of inheritance in c#?

0 Answers  


C Sharp

1 Answers   Wipro,


can any one send the project manager questions in .net

1 Answers  


What is the difference between // comments, /* */ comments and /// comments?

0 Answers  


Why do we parse in c#?

0 Answers  


What is session state in asp net c# with example?

0 Answers  


Can multiple inheritance implemented in c# ?

0 Answers  


Categories