Solved

Trimend() issues

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This is about my first experience with programming Arduino.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
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…

856 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