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
Why do we use methods in c#?
Is php easier than c#?
In languages without exception-handling facilities, we could send an error-handling procedure as a parameter to each procedure that can detect errors that must be handled. What disadvantages are there to this method?
What is difference between the "throw" and "throw ex" in .net?
What is difference between === and ==?
What is the ouput of the following program?
Can delegates be used as callbacks?
What is the and operator in c#?
How do you type a null character?
Why do we use static class in c#?
Is learning c# hard?
What is the delegate in c#?
Illustrate the differences between the system.array.copyto() and system.array.clone()?
What is reflection in c#?
What is static void main in c#?