Click here to Skip to main content
15,892,809 members

How to remove data from string builder

demouser743 asked:

Open original thread
Hi i all having a requirement to delete particular data from a text file. I have written some code to get my exact data to remove but now i am little bit confused in removing that particular data can any one help me.

Initially this is my data in text file where i am storing to a Stringbuilder

101 111111111 1111111111110150105A094101                                                      

52201               1                   1         PPD1         111015111015   1111000020000001

6241110000251                00000000011              1                     1 0111000020000001

822000000100111000020000000000000000000000011                                  111000020000001

52251               1                   1         PPD1         011015111015   1111000020000002

6281110000251                00000000011              1                     1 0111000020000002

822500000100111000020000000000010000000000001                                  111000020000002

9000002000001000000020022200004000000000001000000000001                                       


Now by using certain code i am getting the data to delete i.e assume i would like to delete from 5 to 8 which exists. I am storing this to another StringBuilder as follows

52251               1                   1         PPD1         011015111015   1111000020000002

6281110000251                00000000011              1                     1 0111000020000002

822500000100111000020000000000010000000000001                                  111000020000002


I would like to remove this from the main Stringbuilder i am having. Is this the correct process or if any better way let me know
Tags: C# 3.5, String

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



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