Win32 Edit newline

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • newguy194
    New Member
    • May 2007
    • 25

    Win32 Edit newline

    I have a win32 app which get text from an edit box and stores it in a dynamic array, I was wondering how to make my program ignore the newlines from pressing enter and not show them a part of the dynamic array. The newlines appear as || in my array.
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    Moving to Forum section (please double-check next time and make sure you're not in the 'Articles' section. Thanks :)

    Comment

    • Savage
      Recognized Expert Top Contributor
      • Feb 2007
      • 1759

      #3
      Originally posted by newguy194
      I have a win32 app which get text from an edit box and stores it in a dynamic array, I was wondering how to make my program ignore the newlines from pressing enter and not show them a part of the dynamic array. The newlines appear as || in my array.
      There are several ways,here are two:

      1.Tokenize the string.

      2.Loop trough your array and search for '\n',when you find it, delete it and on it's space put a string terminator.

      Savage

      Comment

      • newguy194
        New Member
        • May 2007
        • 25

        #4
        Originally posted by Savage
        There are several ways,here are two:

        1.Tokenize the string.

        2.Loop trough your array and search for '\n',when you find it, delete it and on it's space put a string terminator.

        Savage
        For some reason looping through the array to delete it doesn't seem to work, it will delete the first of two pipes, then terminate the loop.

        Comment

        • Savage
          Recognized Expert Top Contributor
          • Feb 2007
          • 1759

          #5
          Originally posted by newguy194
          For some reason looping through the array to delete it doesn't seem to work, it will delete the first of two pipes, then terminate the loop.
          Can you show us how have you implemented it?

          Savage

          Comment

          • newguy194
            New Member
            • May 2007
            • 25

            #6
            Originally posted by Savage
            Can you show us how have you implemented it?

            Savage
            I have fixed this problem.

            Comment

            • sicarie
              Recognized Expert Specialist
              • Nov 2006
              • 4677

              #7
              Do you mind posting how, in case anyone else has a similar issue?

              Comment

              Working...