返回" s"的子字符串,从start(包括)到end(不包括)。
以下是语法。
(subs s start end)
参数 - " S"是输入字符串, "start"是从其开始子字符串的索引位置, "end"是结束子字符串的索引位置。
返回值 - 子字符串。
以下是Clojure中字符串格式的示例。
(ns clojure.examples.hello (:gen-class)) (defn hello-Learnfk [] (println (subs "HelloLearnfk" 2 5)) (println (subs "HelloLearnfk" 5 7))) (hello-Learnfk)
上面的程序产生以下输出。
链接:https://www.learnfk.comhttps://www.learnfk.com/clojure/clojure-strings-subs.html
来源:LearnFk无涯教程网
llo Le
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)