Solved

Trimend() issues

Posted on 2013-01-15
4
330 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
  • 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now