目录

split-lines

拆分字符串基于转义字符\ n或\ r\n。

语法 (Syntax)

以下是语法。

(split-lines str)

Parameters - 'str'是需要拆分的字符串。

Return Value - 拆分字符串。

例子 (Example)

以下是Clojure中分割线的示例。

(ns clojure.examples.hello
   (:gen-class))
(defn hello-world []
   (println (clojure.string/split-lines "Hello\nWorld")))
(hello-world)

输出 (Output)

上述程序产生以下输出。

[Hello World]

请注意,在上面的输出中,字符串“Hello”和“World”都是单独的字符串。

↑回到顶部↑
WIKI教程 @2018