Greetings;
In vanilla autolisp, I'm revisiting a simple string parser
I'm supplied with very long ( 400-500 ) character lines of text. I'm trying to parse so that neither the 1st or last character is a space and that new string be a shorter than the maximum specified length
(setq s1 "how now brown cow how have you been this week? how about next week")
;;;SPACE PLACEMENT RETURN LIST WITH THE OVERALL (streln) LAST
(setq sl '(4 8 14 18 22 27 31 36 41 47 51 57 62 67))
;;With a specified max of 25 characters, this is list I am trying to achieve in a substr friendly format
;(substr_start_chr . substr_strlen)
(setq pl '((1 . 21) (23 . 28) (52 . 16)))
;the end result
(foreach p pl
(terpri)
(princ (substr s1 (car p) (cdr p))))
how now brown cow how
have you been this week? how
about next week
My present efforts have not been successful or pretty.
Any ideas ? TIA -David