Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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 verbatim string literal and why do we use it?

0 Answers  


What are collections in c#?

0 Answers  


What is default access modifier for class in c#?

0 Answers  


Explain the role of Garbage collector and its generations?

0 Answers   MCN Solutions,


What is tryparse c#?

0 Answers  


can you create a function in c# which can accept varying number of arguments

0 Answers   Cognizant,


what is difference between destruct or and garbage collection ?

0 Answers   Wipro,


What if an error occurs in Catch block, how can you prevent it?

2 Answers   IBM,


What is c# windows form application?

0 Answers  


Explain jagged arrays in c#?

0 Answers  


What?s the difference between an interface and abstract class?

6 Answers   Mind Tree, Siebel,


Can an Assembly have multiple versions

13 Answers   TCS,


Categories