使用start-with?功能

Mah*_*dam 2 clojure

我正在尝试这里显示的函数(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"]]但似乎没有帮助.

Nic*_*zyk 7

您可能忘记了要求命名空间?请参阅以下示例:

(ns simple.strings
  (:require [clojure.string :as str]))

(str/starts-with? "hello, world" "hello")
; true
Run Code Online (Sandbox Code Playgroud)