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
What are the Types of optimization and name a few and how do u do?
What are the different types of delegation?
What are immutable types in c#?
What does assert() do in c#?
What is the purpose of namespace in c#?
What is a console in c#?
What is difference between float and decimal?
What is an array of arrays called?
What is the default value of datetime in c#?
What is virtual class in C#?
What is difference between web and window application?
When should we use delegates in c#?
What is data hiding in c#?
What are Regex / regular expressions ?
What is xaml file in c#?