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 cast in C#?
What is type class in c#?
What is ildasm and obfuscator in net?
Describe ado.net?
what is inheritance and an example in vb.net and c# of when you might use it?
What is the wildcard character in sql?
What is stringbuilder c#?
Does c# have a 'throws' clause?
Can an exception be thrown from a catch block?
From which base class do all Web Forms inherit from?
What is the difference between ref and out parameters in c#?
Explain how to use an extender provider in the project.
Explain how to parse a datetime string?
What does void mean unity?
What is wcf c#?