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

Enlist all the components of an ado.net framework?

478


Can delegates be used as callbacks?

490


What is iqueryable?

478


What is a collection class in c#?

473


List down the reason behind the usage of c# language.

644






Explain jagged arrays in c#?

570


What is the difference between ref and out parameters in c#?

457


How to put assembly in gac?

541


What is the difference between ienumerable and enumerable?

450


What is session c#?

525


What is default boolean value in c#?

481


Explain the Different types of configuration files in .net?

569


What is the difference between public, static, and void?

475


What is default value of decimal c#?

475


What's the difference between System.String and System..StringBuilder in C#?

501