要查找字符串中的字符数,可以使用计数函数。
以下是语法。
链接:https://www.learnfk.comhttps://www.learnfk.com/clojure/clojure-strings-count.html
来源:LearnFk无涯教程网
(count stringvariable)
参数 - stringvariable,是需要确定字符数的字符串。
返回值 - 字符串中的字符数。
以下是Clojure中字符串格式的示例。
(ns clojure.examples.hello (:gen-class)) (defn hello-Learnfk [] (println (count "Hello"))) (hello-Learnfk)
上面的程序产生以下输出。
5
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)