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 are the steps to make an assembly to public?

0 Answers  


Explain the three test cases in unit testing?

0 Answers   Siebel,


Is there any sample c# code for simple threading?

0 Answers  


Is IIS is required for installing the deployment of windows C#.netapplication and to run.

2 Answers  


Are objects passed by reference in c#?

0 Answers  






What is lazy t?

0 Answers  


What does string format do?

0 Answers  


What is transparent caching with aop ?

0 Answers  


What is overloading and how can this be done ?

4 Answers   MMTS,


Give some examples for built in datatypes in c#?

0 Answers  


What's difference about switch statements in C# ?

1 Answers  


What is console application with example?

0 Answers  


Categories