Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
String Array To String Based On Any Delimiter In C#
WhatsApp
Soumalya Das
Aug 05
2016
966
0
0
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
Up Next
String Array To String Based On Any Delimiter In C#