我正在尝试这里显示的函数(starts-with?):https://clojure.github.io/clojure/clojure.string-api.html当我尝试使用它时,我收到Unable to resolve symbol: starts-with? in this context错误消息.我通过指定修改了我的项目依赖项,:dependencies [[org.clojure/clojure "1.8.0"]]但似乎没有帮助.
您可能忘记了要求命名空间?请参阅以下示例:
(ns simple.strings
(:require [clojure.string :as str]))
(str/starts-with? "hello, world" "hello")
; true
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
288 次 |
| 最近记录: |