|
-
July 28th, 2009, 08:33 AM
#15
Re: Removing the last two lines of a RichTextBox
@Teranoz:
If you consider a large amount of lines (coupla 1000) it is surely faster, to step back through the text character by character to find the CrLf you want.
Splitting will cause the creation of a huge string array, duplicate all string data from .Text, and in the end you put everything back together. Might be a little faster, if a .Text contains only some 20 or 30 lines, but will cause huge string copying operations with larger amounts of text. The other method needs only one string copy operation.
Nevertheless, splitting is certainly one more approach for this, as we often find more'n one solution for a problem. 
@David:
 Originally Posted by dglienna
Never said that. Just commenting on your post...
Ok. Then the answer is: Goto doesn't count. Not for me.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|