split - str-split 函数有什么作用?
问题描述
(str-split) 函数在此构建中做了 什么https://sourceforge.net/p/clipsrules/code/HEAD/tree/branches/63x/core/ PS 我知道 (string-split) 函数在其他语言中的作用,如 C++、C#、Java、Python。但在这里,我无法理解。赖利先生,一切都希望你)))
解决方案
(deffunction MAIN::str-split (?separator ?str)
(bind $?result (create$))
(bind ?index 1)
(while (> (str-length ?str) 0)
(bind ?index (str-index ?separator ?str))
(if (neq ?index FALSE)
then
(bind ?temp_string (sub-string 1 (- ?index 1) ?str))
(if (neq ?temp_string "")
then
(bind $?result (insert$ $?result (+ (length$ $?result) 1)
(create$ ?temp_string)))
)
(bind ?str (sub-string (+ ?index 1) (str-length ?str) ?str))
else
(bind $?result (insert$ $?result (+ (length$ $?result) 1) (create$ ?str)))
(return $?result)
)
)
(return $?result)
)
推荐阅读
- checkbox - 使用复选框和搜索框动态查询或过滤 Google 表格中的表格
- html - 调整浏览器大小时,Div 不让 100% 的宽度
- java - .jar 文件在没有资源文件夹的情况下无法运行
- javascript - 使用 JQuery .find() 访问 Bootstrap Modal 中的输入文本字段
- asynchronous - 开放 API 规范等效于 AMQP 等非 HTTP 协议
- python - Plotly 中的 Seaborn HUE
- r - 如何从命名向量中按名称删除元素?
- url - 您可以在 ChromeOS 中创建自定义快捷方式,包括特定的 URL 和图标,而无需开发者帐户吗?
- asp.net - Azure 应用服务 - 免费套餐 - Cpu 时间(短)
- c# - 一个单词在文本框中重复的次数