Loading ...
Sorry, an error occurred while loading the content.

18145Re: [Clip] String Split

Expand Messages
  • Axel Berger
    Aug 1, 2008
    • 0 Attachment
      "Don - HtmlFixIt.com" wrote:
      > This simply means IF there is a space at the end of the line
      > (or spaces) should they be trimmed or not. It does not insert
      > a space for you.

      Well, that space is already there. My selection contains a line of
      several hundred bytes length. What StrSplit does is go to 70 and
      then go backward to the next space and split the line there. (Or
      something very similar, this is how I did it in BASIC many years
      ago.) So my one line becomes many and at every new line-end there
      was a space originally.

      NB: Your suggestion will only add a single space after the last of
      the lines. In my full version I put an extra newline there.

      My text contains blocks pasted into it with very long or very short
      lines. I add empty lines between paragraphs I want to keep as such,
      find those blocks and do:

      ; Remember empty lines
      ^!InsertSelect
      ^$StrReplace("^P^P";"^T^T";"^$GetSelection$";FALSE;FALSE)$
      ; Make paragraphs one line
      ^!InsertSelect ^$StrReplace("^P";" ";"^$GetSelection$";FALSE;FALSE)$
      ; Make remembered markers line ends
      ^!InsertSelect
      ^$StrReplace("^T^T";"^P";"^$GetSelection$";FALSE;FALSE)$
      ; Split long lines to desired length
      ^!InsertText ^$StrSplit("^$GetSelection$";70;FALSE)$^P
      ; Find next instance
      ^!Goto loop

      Obviously the last FALSE means something else than I expect it to.

      Axel
    • Show all 11 messages in this topic