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

Why do we need generics in c#?

872


What is the reason behind the invention of c#?

1043


How do namespaces work?

919


Can we have static indexer in c#?

851


How can I develop an application that automatically updates itself from the web?

842


What is private readonly in c#?

900


What does the parsefloat function do?

870


Is c# a strongly-typed language?

929


What does it mean to override a method?

902


What is callback in c#?

849


what is object-oriented programming (oop) language?

818


What is difference between array and arraylist in c#?

889


What Is A Multicast Delegate?

1024


Why to use “using” in c#?

999


Does the system.exception class have any cool features?

948