拆分字符串基于转义字符\n或\r\n。
以下是语法。
(split-lines str)
参数 - " str"是需要分割的字符串。
返回值 - 拆分字符串。
以下是Clojure中的分割线示例。
(ns clojure.examples.hello (:gen-class)) (defn hello-Learnfk [] (println (clojure.string/split-lines "Hello\nLearnfk"))) (hello-Learnfk)
上面的程序产生以下输出。
[Hello Learnfk]
请注意,在上面的输出中,字符串" Hello"和" Learnfk"都是单独的字符串。
这一章《Clojure - 字符串 - split-lines函数》你学到了什么?在下面做个笔记吧!做站不易,你的分享是对我们最大的支持
使用 Python Pandas 从 Google Drive 或任何云服务读取 CSV 文件