Solved

Trimend() issues

Posted on 2013-01-15
4
349 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 500 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 article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

630 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