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
What are the 2 broad classifications of data types available in c#?
What is data reader in c#?
Explain deadlock?
Explain the functionalities of satellite assembly?
What is a dynamic assembly?
Can properties be overloaded in c#?
Can we inherit partial class in c#?
Why do we use methods in c#?
What are Types of assemblies that can be created in dotnet
Is stringbuilder thread safe c#?
What are nested classes in c#?
Why is c# good for games?
What is the difference between system.text.stringbuilder and system.string?
Can hashtable have duplicate keys?
What is an enumerator c#?