Click here to Skip to main content
16,020,990 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am reading line of the original file as string, find the length of the line then divide string into parts ......... write to the text file again.... the input file is large, the cost of this solution is high!.

for removing spaces from the end of files, I have an idea I am working on... read character by character if its not space write to anew file if its space read the next character...still working on it...high complexity operation

[edit]Spurious code block removed, large number of full stops reduced to three at a time - OriginalGriff[/edit]
Posted
Updated 7-May-11 22:26pm
v6

Removing spaces from the beginning and end of any string in C# is easy:
myString = myString.Trim();


Why are you using strlen in C#? Each string object has it's own Length property...

Did you mean to post this as a question, or as a comment on someone's answer to a question? I ask, because the first part doesn't appear to make a lot of sense! What are you actually trying to achieve?
 
Share this answer
 
AFAIK there is no strlen in C#. Are you sure you are doing C#? Update the tag correctly.

If it is C#, use Streams rather than the static methods in the File class. Post the relevant code so that someone can help.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900