• Products
    • Isadora
    • Get It
    • ADD-ONS
    • IzzyCast
    • Get It
  • Forum
  • Help
  • Werkstatt
  • Newsletter
  • Impressum
  • Dsgvo
  • Press
  • Isadora
  • Get It
  • ADD-ONS
  • IzzyCast
  • Get It
  • Press
  • Dsgvo
  • Impressum

Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags

    Use Javascript to select a line of Text

    How To... ?
    7
    22
    13126
    Loading More Posts
    • 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.
    • DusX
      DusX Tech Staff @DillTheKraut last edited by DusX

      @dillthekraut

      OK, so.
      NotePad++ is showing CR LF, as the document end of line.
      This matches \r\n ( \r = Carriage Return, \n = Line Feed )

      reference: https://en.wikipedia.org/wiki/...

      So: txt.split("\r\n") should match that every end of line (but splitting on this will not remove any trailing sets from doubles)

      Now if you want to split the text only one DOUBLE breaks... you are looking at CR LF CR LF

      So try: txt.split("\r\n\r\n")

      Troikatronix Technical Support

      • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
      • My Add-ons: https://troikatronix.com/add-ons/?u=dusx
      • Profession Services: https://support.troikatronix.com/support/solutions/articles/13000109444-professional-services

      Running: Win 11 64bit, i7, M.2 PCIe SSD's, 32gb DDR4, nVidia GTX 4070 | located in Ontario Canada.

      D 1 Reply Last reply Reply Quote 1
      • D
        DillTheKraut @DusX last edited by

        @dusx thank you! I guess I just switched \r with \n bevor. And now I know what's happening in the different cases and why ("\n\r") is doing the Job kind as well.

        In between (.../) shows the match of regex and therefore the position of the split:

        ("\r\n\r\n") =
        Line one text 'CR LF'
        line two text (CR LF
        CR LF/)
        third line of text

        ("\r\n") =
        Line one text (CR LF/)
        line two text (CR LF/)
        (CR LF/)
        third line of text

        ("\n\r") = 
        Line one text 'CR LF'
        line two text 'CR' (LF
        CR/)
        'LF'
        third line of text

        1 Reply Last reply Reply Quote 1
        • First post
          Last post