<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: manipulation string in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/manipulation-string/m-p/8045991#M104099</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1166654"&gt;@doaiena&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I've made a small edit to &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/569456"&gt;@Lee_Mac&lt;/a&gt;'s&amp;nbsp;&lt;A href="http://www.lee-mac.com/stringtolist.html" target="_blank"&gt;String to List&lt;/A&gt;&amp;nbsp;function. It will work with multiple entries.&lt;/P&gt;&lt;PRE&gt;(defun LM:str-&amp;gt;lst ( str del / len lst pos )
    (setq len (1+ (strlen del)))
    (while (setq pos (vl-string-search del str))
        (setq lst (cons (strlen (substr str 1 pos)) lst)
              str (substr str (+ pos len))
        )
    )
    (reverse (cons (strlen str) lst))
)

;;;output:
;(LM:STR-&amp;gt;LST "100+25.00+15+22.5+109" "+")
;(3 5 2 4 3)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;FWIW .. no need to change Lee's code. To get the result you have shown, call it like this:&lt;/P&gt;&lt;PRE&gt;(mapcar 'strlen (lm:str-&amp;gt;lst "100+25.00+15+22.5+109" "+"))&lt;/PRE&gt;</description>
    <pubDate>Mon, 04 Jun 2018 21:26:09 GMT</pubDate>
    <dc:creator>ronjonp</dc:creator>
    <dc:date>2018-06-04T21:26:09Z</dc:date>
    <item>
      <title>manipulation string</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/manipulation-string/m-p/8045932#M104096</link>
      <description>&lt;P&gt;Hi people,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a string that i´d like to count in a different way. I know (and use) "strlen" but it is not what i want. So, i´d like to count numbers of characters before "+" and after "+":&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;+&lt;FONT color="#00FFFF"&gt;25&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;answer&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;1 &lt;FONT color="#000000"&gt;and &lt;FONT color="#00FFFF"&gt;2&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;100+25.00&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;answer&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;3&lt;/FONT&gt; and &lt;FONT color="#00FFFF"&gt;5&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Someone could help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 20:51:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/manipulation-string/m-p/8045932#M104096</guid>
      <dc:creator>alexandre_benekowski</dc:creator>
      <dc:date>2018-06-04T20:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: manipulation string</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/manipulation-string/m-p/8045965#M104097</link>
      <description>&lt;P&gt;Quick example:&lt;/P&gt;&lt;PRE&gt;(defun _foo (string del / i)
  (if (setq i (vl-string-search del string))
    (list (setq i (strlen (substr string 1 i))) (- (strlen string) (1+ i)))
  )
)
(_foo "100+25.00" "+")
;; (3 5)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 21:21:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/manipulation-string/m-p/8045965#M104097</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2018-06-04T21:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: manipulation string</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/manipulation-string/m-p/8045978#M104098</link>
      <description>&lt;P&gt;I've made a small edit to &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/569456"&gt;@Lee_Mac&lt;/a&gt;'s&amp;nbsp;&lt;A href="http://www.lee-mac.com/stringtolist.html" target="_blank"&gt;String to List&lt;/A&gt;&amp;nbsp;function. It will work with multiple entries.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;;Lee Mac's LM:str-&amp;gt;lst routine /with a small edit/&lt;BR /&gt;;http://lee-mac.com/stringtolist.html&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;(defun LM:str-&amp;gt;lst ( str del / len lst pos )
    (setq len (1+ (strlen del)))
    (while (setq pos (vl-string-search del str))
        (setq lst (cons (strlen (substr str 1 pos)) lst)
              str (substr str (+ pos len))
        )
    )
    (reverse (cons (strlen str) lst))
)

;;;output:
;(LM:STR-&amp;gt;LST "100+25.00+15+22.5+109" "+")
;(3 5 2 4 3)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 21:25:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/manipulation-string/m-p/8045978#M104098</guid>
      <dc:creator>doaiena</dc:creator>
      <dc:date>2018-06-04T21:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: manipulation string</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/manipulation-string/m-p/8045991#M104099</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1166654"&gt;@doaiena&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I've made a small edit to &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/569456"&gt;@Lee_Mac&lt;/a&gt;'s&amp;nbsp;&lt;A href="http://www.lee-mac.com/stringtolist.html" target="_blank"&gt;String to List&lt;/A&gt;&amp;nbsp;function. It will work with multiple entries.&lt;/P&gt;&lt;PRE&gt;(defun LM:str-&amp;gt;lst ( str del / len lst pos )
    (setq len (1+ (strlen del)))
    (while (setq pos (vl-string-search del str))
        (setq lst (cons (strlen (substr str 1 pos)) lst)
              str (substr str (+ pos len))
        )
    )
    (reverse (cons (strlen str) lst))
)

;;;output:
;(LM:STR-&amp;gt;LST "100+25.00+15+22.5+109" "+")
;(3 5 2 4 3)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;FWIW .. no need to change Lee's code. To get the result you have shown, call it like this:&lt;/P&gt;&lt;PRE&gt;(mapcar 'strlen (lm:str-&amp;gt;lst "100+25.00+15+22.5+109" "+"))&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Jun 2018 21:26:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/manipulation-string/m-p/8045991#M104099</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2018-06-04T21:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: manipulation string</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/manipulation-string/m-p/8045996#M104100</link>
      <description>&lt;P&gt;That works too. It just makes the statement a bit longer. Depends on&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3110877"&gt;@alexandre_benekowski&lt;/a&gt;'s needs.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 21:30:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/manipulation-string/m-p/8045996#M104100</guid>
      <dc:creator>doaiena</dc:creator>
      <dc:date>2018-06-04T21:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: manipulation string</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/manipulation-string/m-p/8046006#M104101</link>
      <description>&lt;P&gt;Sure ..&amp;nbsp;I'd think the outcome would be something more like this from the description.&lt;/P&gt;&lt;PRE&gt;(setq l (mapcar 'strlen (lm:str-&amp;gt;lst "100+25.00+15+22.5+109" "+")))
(mapcar '(lambda (r j) (list r j)) l (cdr l))
;; '((3 5) (5 2) (2 4) (4 3))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 21:35:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/manipulation-string/m-p/8046006#M104101</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2018-06-04T21:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: manipulation string</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/manipulation-string/m-p/8047303#M104102</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3110877"&gt;@alexandre_benekowski&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;... i´d like to count numbers of characters before "+" and after "+":&lt;/P&gt;
&lt;P&gt;ex:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000"&gt;1&lt;/FONT&gt;+&lt;FONT color="#00ffff"&gt;25&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;answer&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000"&gt;1 &lt;FONT color="#000000"&gt;and &lt;FONT color="#00ffff"&gt;2&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;100+25.00&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;answer&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;FONT color="#ff0000"&gt;3&lt;/FONT&gt; and &lt;FONT color="#00ffff"&gt;5&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
….&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;(setq str "1234+56")&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Then:&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;(strcat&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; (itoa (setq pre (vl-string-position (ascii "+") str)))&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; " and "&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; (itoa (- (strlen str) pre 1))&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;returns:&lt;/EM&gt;&lt;BR /&gt;"&lt;FONT color="#000000"&gt;4&lt;/FONT&gt; and &lt;FONT color="#000000"&gt;2&lt;/FONT&gt;"&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 11:44:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/manipulation-string/m-p/8047303#M104102</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2018-06-05T11:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: manipulation string</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/manipulation-string/m-p/8048902#M104103</link>
      <description>&lt;P&gt;I Kent!!!&lt;/P&gt;&lt;P&gt;thank you so very much!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It work!!!!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 21:06:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/manipulation-string/m-p/8048902#M104103</guid>
      <dc:creator>alexandre_benekowski</dc:creator>
      <dc:date>2018-06-05T21:06:14Z</dc:date>
    </item>
  </channel>
</rss>

