StringReader Go Back to FirstLine?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike

    StringReader Go Back to FirstLine?

    Is it true that these objects are forwardonly?

    If not, can someone show me how to go back to line 1, after I have read the first 100 lines.

    Thanks

    Mike
  • Jay B. Harlow [MVP - Outlook]

    #2
    Re: StringReader Go Back to FirstLine?

    Mike,
    Have you considered creating a new StringReader? Then reading from this new
    StringReader from the beginning of the string.

    Hope this helps
    Jay


    "Mike" <anonymous@disc ussions.microso ft.com> wrote in message
    news:C82F8745-DB94-4F40-AC91-E69683D65E56@mi crosoft.com...[color=blue]
    > Is it true that these objects are forwardonly?
    >
    > If not, can someone show me how to go back to line 1, after I have read[/color]
    the first 100 lines.[color=blue]
    >
    > Thanks
    >
    > Mike[/color]


    Comment

    • Dilip Krishnan

      #3
      Re: StringReader Go Back to FirstLine?

      You could try reading it with a BufferedStream and a StreamReader. If
      you need examples let me know

      Mike wrote:
      [color=blue]
      > Is it true that these objects are forwardonly?
      >
      > If not, can someone show me how to go back to line 1, after I have read the first 100 lines.
      >
      > Thanks
      >
      > Mike[/color]

      --
      Regards,
      Dilip Krishnan
      MCAD, MCSD.net
      dilipdotnet at apdiya dot com

      Comment

      • kids

        #4
        Re: StringReader Go Back to FirstLine?

        You can create string array to hold each line read.
        string readLine[];

        when you want to go back to the first line -> readLine[0]


        "Mike" <anonymous@disc ussions.microso ft.com> wrote in message
        news:C82F8745-DB94-4F40-AC91-E69683D65E56@mi crosoft.com...[color=blue]
        > Is it true that these objects are forwardonly?
        >
        > If not, can someone show me how to go back to line 1, after I have read[/color]
        the first 100 lines.[color=blue]
        >
        > Thanks
        >
        > Mike[/color]


        Comment

        Working...