Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Trimend() issues

Posted on 2013-01-15
4
Medium Priority
?
353 Views
Last Modified: 2013-01-15
I am tring to trim an string from a string builder but it is not trimming the character
 StringBuilder sb = new StringBuilder();
            if (emailSent == 1)
            {
                ListViewSelectedItemCollection col = radlvEmp.SelectedItems;

                
                foreach (ListViewDataItem item in col)
                {
                    sb.Append(Convert.ToString(item.Value) + ", ");
                }
                
            }
            string s = sb.ToString();
            s = s.ToString().Trim();
            s.TrimEnd(',');

Open in new window

the value is still me.me@yahoo.com,
0
Comment
Question by:r3nder
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 22

Expert Comment

by:p_davis
ID: 38779865
s = s.TrimEnd(',');
0
 
LVL 22

Accepted Solution

by:
p_davis earned 2000 total points
ID: 38779866
TrimEnd returns a string, it doesn't directly manipulate the given string.
0
 
LVL 6

Author Closing Comment

by:r3nder
ID: 38780113
Thanks P_davis
didnt see that
0
 
LVL 22

Expert Comment

by:p_davis
ID: 38780122
you're welcome.... I've done it many times.
0

Featured Post

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question