<?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: split from string in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/split-from-string/m-p/12542717#M18199</link>
    <description>&lt;P&gt;hey there,&lt;/P&gt;&lt;P&gt;check the function&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun string_to_list (string / _list)
	(setq _list (vl-string-&amp;gt;list string)) 
	(foreach delimiter (vl-string-&amp;gt;list "x.-")
		(setq _list (subst 32 delimiter _list))
	)
	(mapcar '(lambda (element) (vl-princ-to-string element))
			 (read (strcat "(" (vl-list-&amp;gt;string _list) ")"))
	)
)&lt;/LI-CODE&gt;&lt;P&gt;using&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Command: &lt;EM&gt;&lt;STRONG&gt;(string_to_list "L 75x75x5-LG... 1240")&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;("L" "75" "75" "5" "LG" "1240")&lt;/P&gt;&lt;P&gt;Command: &lt;EM&gt;&lt;STRONG&gt;(string_to_list "L 75x75x5")&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;("L" "75" "75" "5")&lt;/P&gt;&lt;P&gt;Command: &lt;EM&gt;&lt;STRONG&gt;(string_to_list "LG.1240")&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;("LG" "1240")&lt;/P&gt;&lt;P&gt;Command: &lt;EM&gt;&lt;STRONG&gt;(string_to_list "L 75x5")&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;("L" "75" "5")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Feb 2024 06:17:56 GMT</pubDate>
    <dc:creator>komondormrex</dc:creator>
    <dc:date>2024-02-06T06:17:56Z</dc:date>
    <item>
      <title>split from string</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/split-from-string/m-p/12542677#M18198</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a situation that I have a string and I want to split it like....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"L 75x75x5-LG... 1240" TO ("L"&amp;nbsp; "75" "75" "5" "LG" "1240")&lt;/P&gt;&lt;P&gt;AND&amp;nbsp;&lt;/P&gt;&lt;P&gt;"L 75x75x5" TO ("L" "75" "75" "5")&lt;/P&gt;&lt;P&gt;AND&lt;/P&gt;&lt;P&gt;"LG.1240" TO ("LG" "1240")&lt;/P&gt;&lt;P&gt;AND&lt;/P&gt;&lt;P&gt;"L 75x5" TO ("L" "75" "5")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is it possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Avinash&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2024 05:31:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/split-from-string/m-p/12542677#M18198</guid>
      <dc:creator>avinash00002002</dc:creator>
      <dc:date>2024-02-06T05:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: split from string</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/split-from-string/m-p/12542717#M18199</link>
      <description>&lt;P&gt;hey there,&lt;/P&gt;&lt;P&gt;check the function&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun string_to_list (string / _list)
	(setq _list (vl-string-&amp;gt;list string)) 
	(foreach delimiter (vl-string-&amp;gt;list "x.-")
		(setq _list (subst 32 delimiter _list))
	)
	(mapcar '(lambda (element) (vl-princ-to-string element))
			 (read (strcat "(" (vl-list-&amp;gt;string _list) ")"))
	)
)&lt;/LI-CODE&gt;&lt;P&gt;using&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Command: &lt;EM&gt;&lt;STRONG&gt;(string_to_list "L 75x75x5-LG... 1240")&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;("L" "75" "75" "5" "LG" "1240")&lt;/P&gt;&lt;P&gt;Command: &lt;EM&gt;&lt;STRONG&gt;(string_to_list "L 75x75x5")&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;("L" "75" "75" "5")&lt;/P&gt;&lt;P&gt;Command: &lt;EM&gt;&lt;STRONG&gt;(string_to_list "LG.1240")&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;("LG" "1240")&lt;/P&gt;&lt;P&gt;Command: &lt;EM&gt;&lt;STRONG&gt;(string_to_list "L 75x5")&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;("L" "75" "5")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2024 06:17:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/split-from-string/m-p/12542717#M18199</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2024-02-06T06:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: split from string</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/split-from-string/m-p/12544432#M18200</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/351340"&gt;@avinash00002002&lt;/a&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13423916"&gt;@komondormrex&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's another way to write that function:&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;(defun _s2l (str)
  (mapcar 'vl-princ-to-string (read (strcat "(" (vl-string-translate ".x-" "   " str) ")")))
)
(_s2l "L 75x75x5-LG... 1240")
;; ("L" "75" "75" "5" "LG" "1240") &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2024 20:46:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/split-from-string/m-p/12544432#M18200</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2024-02-06T20:46:23Z</dc:date>
    </item>
  </channel>
</rss>

