Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / urukundappa.g

using System;
using System.Text;

class Program
{
static void Main()
{
// Create an array with five strings.
string[] array =
new string["Dot", "Net", "Perls", "Sam", "Allen"];

// Call the methods.
string result1 = ConvertStringArrayToString(array);
string result2 = ConvertStringArrayToStringJoin
(array);

// Display the results.
Console.WriteLine(result1);
Console.WriteLine(result2);
Console.Read();
}

static string ConvertStringArrayToString(string[] array)
{
// Concatenate all the elements into a
StringBuilder.
StringBuilder builder = new StringBuilder();
foreach (string value in array)
{
builder.Append(value);
builder.Append('.');
}
return builder.ToString();
}

StringBuilder [] stringBuilders = builder.ToArray();

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is parallel programming in c#?

876


How do I start a program in c#?

938


What is .cs file in c#?

870


How many types of constructors are available in c#?

1008


What is the differences between datagrid, datalist and repeater in .net?

941


Can main method be final?

869


What is a string c#?

866


Is concurrent queue thread safe?

859


What is a base class in C#?

930


What are scriptable objects?

875


What is the difference between inheritance and abstract class?

847


Are c# strings null terminated?

982


Can the accessibility of a type member be greater than the accessibility of its containing type?

903


What's the difference between a static method and a non static method c#?

959


What are the namespace level elements?

909