Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. end of string in C#

end of string in C#

Scheduled Pinned Locked Moved C#
csharp
8 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lawrenceinba
    wrote on last edited by
    #1

    '\0' is the above command valid for calculating end of line in while loop... if not wat should be used to EOF identification

    the quieter u become more u hear

    S L G 3 Replies Last reply
    0
    • L lawrenceinba

      '\0' is the above command valid for calculating end of line in while loop... if not wat should be used to EOF identification

      the quieter u become more u hear

      S Offline
      S Offline
      SeMartens
      wrote on last edited by
      #2

      Hi, as far as I know does the .NET-Framework abstracts the issue of string termination. If you read from a file for example, you can use the StreamReader.ReadLine(). This will read a whole line... Regards Sebastian

      It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.

      1 Reply Last reply
      0
      • L lawrenceinba

        '\0' is the above command valid for calculating end of line in while loop... if not wat should be used to EOF identification

        the quieter u become more u hear

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Are you looking for the "End of String", or "End of File"?

        I are troll :)

        L 1 Reply Last reply
        0
        • L lawrenceinba

          '\0' is the above command valid for calculating end of line in while loop... if not wat should be used to EOF identification

          the quieter u become more u hear

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          lawrenceinba wrote:

          '\0' is the above command valid for calculating end of line in while loop...

          I have never seen any system where the NUL character is used as end of line. It's commonly used as end of string in systems that doesn't have a String object that keeps track of the length.

          lawrenceinba wrote:

          if not wat should be used to EOF identification

          The '\x1a' character is the EOF marker, however .NET doesn't use any EOF marker. You should ask about what you are trying to do instead of asking about some obsolete techniques that doesn't apply to C#.

          Despite everything, the person most likely to be fooling you next is yourself.

          L 1 Reply Last reply
          0
          • L Lost User

            Are you looking for the "End of String", or "End of File"?

            I are troll :)

            L Offline
            L Offline
            lawrenceinba
            wrote on last edited by
            #5

            end of string

            the quieter u become more u hear

            L 1 Reply Last reply
            0
            • G Guffa

              lawrenceinba wrote:

              '\0' is the above command valid for calculating end of line in while loop...

              I have never seen any system where the NUL character is used as end of line. It's commonly used as end of string in systems that doesn't have a String object that keeps track of the length.

              lawrenceinba wrote:

              if not wat should be used to EOF identification

              The '\x1a' character is the EOF marker, however .NET doesn't use any EOF marker. You should ask about what you are trying to do instead of asking about some obsolete techniques that doesn't apply to C#.

              Despite everything, the person most likely to be fooling you next is yourself.

              L Offline
              L Offline
              lawrenceinba
              wrote on last edited by
              #6

              i'll give input to a while loop....it should exit at end of string this is what i need

              the quieter u become more u hear

              G 1 Reply Last reply
              0
              • L lawrenceinba

                end of string

                the quieter u become more u hear

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Use String.Length to locate the end of the string.

                I are troll :)

                1 Reply Last reply
                0
                • L lawrenceinba

                  i'll give input to a while loop....it should exit at end of string this is what i need

                  the quieter u become more u hear

                  G Offline
                  G Offline
                  Guffa
                  wrote on last edited by
                  #8

                  If you want to loop through the characters in a string, you can use the enumerator or the Length property:

                  foreach (char c in daString) {
                  Console.WriteLine(c);
                  }

                  for (int i = 0; i < daString.Length; i++) {
                  Console.WriteLine(daString[i]);
                  }

                  Despite everything, the person most likely to be fooling you next is yourself.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups