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

Explain About friend and Protected friend

1 Answers  


What is the main purpose of delegates in c#?

1 Answers  


What is the default value of guid in c#?

1 Answers  


What are the desktop applications?

1 Answers  


What is the use of table aliases?

1 Answers  


How many types of interface are there in c#?

1 Answers  


Explain about WSDL

1 Answers   Digital GlobalSoft,


Difference between a sub and a function in c#.

1 Answers  


Can we declare class as protected?

1 Answers   Infosys,


What is delay signing..??

1 Answers   HCL,


Explain the working of serialization?

1 Answers  


Describe how a .net application is compiled and executed

1 Answers  


Categories