Click here to Skip to main content
15,918,003 members
Home / Discussions / C#
   

C#

 
Questioncombo box Pin
balanjingot9-May-07 22:02
balanjingot9-May-07 22:02 
AnswerRe: combo box Pin
Arun.Immanuel9-May-07 22:20
Arun.Immanuel9-May-07 22:20 
GeneralRe: combo box Pin
balanjingot9-May-07 22:27
balanjingot9-May-07 22:27 
QuestionHow to send message to certain process? Pin
Smart Markey9-May-07 21:56
Smart Markey9-May-07 21:56 
AnswerRe: How to send message to certain process? Pin
Luc Pattyn9-May-07 23:25
sitebuilderLuc Pattyn9-May-07 23:25 
QuestionSystem.OutOfMemoryExeception Pin
Stoyan Furnadzhiev9-May-07 21:50
Stoyan Furnadzhiev9-May-07 21:50 
AnswerRe: System.OutOfMemoryExeception Pin
Martin#9-May-07 23:10
Martin#9-May-07 23:10 
AnswerRe: System.OutOfMemoryExeception Pin
Luc Pattyn9-May-07 23:21
sitebuilderLuc Pattyn9-May-07 23:21 
Hi,

seems like you are splitting a file into two parts, based on a line starting
with BQ. Now why would you use StringBuilder objects to do that ?
A StringBuilder is very efficient at collecting and possibly modifying text
content, particularly if it has sufficient capacity (otherwise internally a
new array has to be created and all data copied, everytime the capacity is
insufficient).

Depending on what you want to do with the two parts afterwards, I would
choose one of the following:
- create two files on disk; this avoids needing to have all data in memory at once;
- create two ArrayLists or List<string> in memory; this avoids the concatenation
of all text lines.

Even if you need each part as a StringBuilder, an ArrayList/List approach
allows you to determine the amount of data and create the StringBuilder object
with the right capacity, hence copying the data only once.

Smile | :)


Luc Pattyn

[My Articles]

Questionplz Help Pin
IrfanHaleem9-May-07 21:48
IrfanHaleem9-May-07 21:48 
AnswerRe: plz Help Pin
Rajesh R Subramanian9-May-07 21:56
professionalRajesh R Subramanian9-May-07 21:56 
AnswerRe: plz Help Pin
Vikram A Punathambekar9-May-07 22:14
Vikram A Punathambekar9-May-07 22:14 
QuestionXML Parsing C# Pin
satsumatable9-May-07 21:46
satsumatable9-May-07 21:46 
AnswerRe: XML Parsing C# Pin
DavidNohejl9-May-07 22:07
DavidNohejl9-May-07 22:07 
QuestionSelectAll - not working on a maskededitbox [modified] Pin
tcss9-May-07 21:35
tcss9-May-07 21:35 
AnswerRe: SelectAll - not working on a maskededitbox Pin
tcss10-May-07 0:44
tcss10-May-07 0:44 
QuestionNEED HELP c# remoting need remotable class to use server's class's function Pin
neodeaths9-May-07 21:26
neodeaths9-May-07 21:26 
QuestionHow to restart the program after a function? Pin
Missy Glory9-May-07 21:12
Missy Glory9-May-07 21:12 
AnswerRe: How to restart the program after a function? Pin
Martin#9-May-07 21:20
Martin#9-May-07 21:20 
GeneralRe: How to restart the program after a function? Pin
Missy Glory9-May-07 21:33
Missy Glory9-May-07 21:33 
GeneralRe: How to restart the program after a function? Pin
Martin#9-May-07 21:38
Martin#9-May-07 21:38 
AnswerRe: How to restart the program after a function? Pin
Leyu10-May-07 2:15
Leyu10-May-07 2:15 
QuestionCalling Form Twice Pin
gvanto9-May-07 20:31
gvanto9-May-07 20:31 
AnswerRe: Calling Form Twice Pin
sam#9-May-07 20:52
sam#9-May-07 20:52 
GeneralRe: Calling Form Twice Pin
gvanto9-May-07 21:24
gvanto9-May-07 21:24 
AnswerRe: Calling Form Twice Pin
Martin#9-May-07 21:37
Martin#9-May-07 21:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.