how to convert String array to StringBuilder array or vice
versa?

Answer Posted / mohammed ameem

string [] strings = new string[]{"abcd","efgh","ijkl"}();
//create generic list of stringbuilder of length equal to
string array
List<System.Text.StringBuilder> stringBs = new
List<System.Text.StringBuilder>(strings.Length);
for(int i=0;i<strings.Length;i++)
{
stringBS[i] = new StringBuilder(s);//initialize
stringbuilder object
}
StringBuilder [] stringBuilders = stringBS.ToArray();

Is This Answer Correct ?    2 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between call by value and call by reference in C#?

740


What is a statement c#?

693


What is the symbol used for in c#?

683


Can I define my own exceptions?

663


Can we declare class as protected?

742


What is the use of console?

662


How can you access a private method of a class?

676


What are concrete classes?

653


What is a decimal c#?

623


Why is hashset faster?

674


Explain about multithreading?

748


What is a hash table in c#?

707


How do you clear a list in c#?

672


Hi to all..I have to create an intranet application on C#.NET windows Application so please please let can you people help me as iam new in .NET and if u have any samples or website address from where i can get sample please let know.

3992


What is generic method in c#?

667