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
padmapriya patruni
NA
74
117.1k
spliting
Apr 10 2014 8:23 AM
this is code is repeate the values.but my questions it should be no repetation plz help me
plz find the document. if send,5,5-6. output is 5,1,2,34,5.but need to no repetation.
string output = null;
if (!String.IsNullOrEmpty(PagesId))
{
if (PagesId.Contains("-"))
{
string[] split = PagesId.Split(',');
string[] split2 = split[1].Split('-');
var sb = new System.Text.StringBuilder();
for (int i = int.Parse(split2[0]); i <= int.Parse(split2[1]); i++)
{
sb.Append(i.ToString());
sb.Append(",");
}
output = split[0] + "," + sb.ToString().TrimEnd(',');
}
else
{
output = PagesId;
}
Reply
Answers (
1
)
PDF TO WORD File
Lear C#