TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
String Array To String Based On Any Delimiter In C#
Soumalya Das
Aug 05
2016
Code
903
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Runtime.InteropServices;
using
System.Text;
using
System.Threading.Tasks;
namespace
ConsoleApplicationdemo
{
class
Program
{
static
void
Main(
string
[] args)
{
///////////string array to string//////////////
string
[] arr = {
"one"
,
"two"
,
"three"
};
string
delimeter =
"-"
;
demo obj =
new
demo();
obj.joinstring(delimeter, arr);
Console.ReadKey();
}
}
class
demo
{
public
void
joinstring(
string
delimeter,
string
[] arr)
{
string
joinitem =
string
.Join(delimeter, arr);
Console.WriteLine(joinitem);
}
}
}
string array to string