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 is type system in c#?
What are boxing and unboxing?
Why does my windows application pop up a console window every time I run it?
Explain the three services model (three-tier application). Presentation (ui), business (logic and underlying code) and data (from storage or other sources).
Can you use foreach iteration on arrays in c#?
What is a bool in c#?
How do you escape in c#?
Differentiate between static class and singleton instance?
What is a void c#?
What are winforms in c#?
What is gac? What are the steps to create an assembly and add it to the gac?
Define a partial class?
Can you store different types in an array in c#?
How does split work in c#?
Explain circular reference in c#?