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 |
What are the steps to make an assembly to public?
Explain the three test cases in unit testing?
Is there any sample c# code for simple threading?
Is IIS is required for installing the deployment of windows C#.netapplication and to run.
Are objects passed by reference in c#?
What is lazy t?
What does string format do?
What is transparent caching with aop ?
What is overloading and how can this be done ?
Give some examples for built in datatypes in c#?
What's difference about switch statements in C# ?
What is console application with example?