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 does clr stand for?
What is data hiding in c#?
hi all.... i need code snippets for store and retrive tiff fromat images in sqlserver....... kindy provide it.......
What is the difference between int16 and int32 in c#?
Define the term immutable ?
Can I use parseint?
Why do we use partial class in c#?
Explain About .NET Framework
Explain about Threading Types.
What is the use of delegates in c#?
What is type checking in c#?
Is hashset ordered c#?
Define Abstract Class in C#
Why do we use constructors in c#?
What is the adv of using System.Text.StringBuilder over System.String?