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
Yuvraj Jambhle
NA
93
8.3k
how to show checkbox list items in one line using C#
Sep 17 2020 7:58 AM
I have written a code for the same.
private
void
btnColumnWrite_Click(
object
sender, EventArgs e)
{
string
s =
""
;
for
(
int
i = 0; i < checkedListBox1.Items.Count; i++)
{
if
(checkedListBox1.GetItemChecked(i))
{
s += checkedListBox1.Items[i] +
","
;
}
}
StreamWriter SwriteData =
new
StreamWriter(@
"C:\Users\user\Desktop\ReportTmplate\Test.txt"
);
SwriteData.WriteLine(
"("
+ s +
")"
);
SwriteData.Close();
}
When I execute this above code I got solution like wise : T1,T2,T3,T4,
But I want this like - T1,T2,T3,T4
I want to remove the last comma "," Symbol which is coming after T4 (Means last item selection), So please guide me on how to avoid this last ",".
Reply
Answers (
4
)
how to encrypt string using AES 128 bit in c#?
Sharepoint REST API PATCH Termstore items in Power Automation