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
Why do we use lambda expression in c#?
what is the difference between convert.tostring() and tostring() functions ?
What is a derived class in c#?
Define Abstract Class in C#
What are the value types in c#?
To allow an element to be accessed using a unique key which .NET collection class is used ?
Is c# static or dynamic?
Why does dllimport not work for me?
How many bytes is an int in c#?
Why hashtable is thread safe in c#?
What is a string in c#?
What is the purpose of a namespace?
Explain the differences between static, void and public in c#?
Define c# and list the features.
What is default value of decimal c#?