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
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Murali Kris
1.5k
254
48.4k
Split string from List<string> to a string.
Nov 5 2018 5:16 AM
Hi,
how can i split string from List <string> list .
here is the code:
char[] mychars {
;
}
List<string> textn = new List<string>(new[] { row["PERMISSIONS"].ToString() }); // row[per] from datatable.
//textn returns some data like one,two,three
string lines;
lines = textn.ToString(); // assigning to lines it returns (
=System.String[]
)
string[] names = lines.Split(mychars, StringSplitOptions.None);
//string[] names = lines.Split(mychars); tried but no luck same error.
foreach (var item in names)
{
Console.WriteLine(item.ToString()); // returns =
System.String[]
}
input from datatable is one;two;three;four
expected output is one \n two \n three \n four
Any help here.
Reply
Answers (
3
)
Difference between strlen() and sizeof() for string in C ?
The process cannot access the file...used by another process