明经通道 发表于 2012-8-29 18:30:52

acad_strlsort 以ASCII码字母顺序对字符串表进行排序

<P id=crleadin class=cr_leadin>以ASCII码字母顺序对字符串表进行排序</P><PRE class=prog_in_end>(acad_strlsort list) </PRE>
<P class=Heading-2>参数</P>
<P class=define_head>list</P>
<P class=define_text>要排序的字符串表&nbsp;</P>
<P class=Heading-2>返回值</P>
<P class=body>排序后的相同字符串表。如果 list 参数是一个无效表或者没有足够的内存来进行排序,acad_strlsort 函数返回 nil。</P>
<P class=Heading-2>示例</P>
<P class=body>下列代码将一年中十二个月的月名的缩写字符串表按字母顺序进行排序:</P>
<P class=prompt_end>命令:<SPAN class=CharSansBold> (setq mos '("Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug"</SPAN> </P>
<P class=prompt_end><SPAN class=CharSansBold>"Sep" "Oct" "Nov" "Dec"))</SPAN> </P>
<P class=prompt_end>("Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec")</P>
<P class=prompt_end>命令: <SPAN class=CharSansBold>(acad_strlsort mos)</SPAN> </P>
<P class=prompt_end>("Apr" "Aug" "Dec" "Feb" "Jan" "Jul" "Jun" "Mar" "May" "Nov" "Oct" "Sep")</P>

明经通道 发表于 2012-8-29 18:33:56

示例预留

花生宝宝 发表于 2022-8-16 10:32:41

(setq mos '("jam" "feb" "mar" "jun" "jul" "aug" "sep" "oct" "nov" "dec"))

(acad_strlsort mos)

返回:("aug" "dec" "feb" "jam" "jul" "jun" "mar" "nov" "oct" "sep")
页: [1]
查看完整版本: acad_strlsort 以ASCII码字母顺序对字符串表进行排序