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


Please Help Members By Posting Answers For Below Questions

What does clr stand for?

478


What is data hiding in c#?

501


hi all.... i need code snippets for store and retrive tiff fromat images in sqlserver....... kindy provide it.......

1395


What is the difference between int16 and int32 in c#?

476


Define the term immutable ?

629






Can I use parseint?

488


Why do we use partial class in c#?

489


Explain About .NET Framework

529


Explain about Threading Types.

600


What is the use of delegates in c#?

480


What is type checking in c#?

512


Is hashset ordered c#?

503


Define Abstract Class in C#

546


Why do we use constructors in c#?

585


What is the adv of using System.Text.StringBuilder over System.String?

539