adspace


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

What is expression tree in c#?

998


How to assign Null value to Var?

1063


How do you inherit a class into other class in c#?

993


Which namespaces are necessary to create a localized application?

1142


Why can't we use a static class instead of singleton?

954


What is an abstract class c#?

969