starts-with?

added
1.8

ns
clojure.string

type
function

(starts-with? s substr)

True if s starts with substr.

                (ns tst.xyz.core
  (:use clojure.test )
  (:require [clojure.string :as str] ))

(deftest t-starts-with?
  (is (str/starts-with? "abcde" "a"))
  (is (str/starts-with? "abcde" "ab"))
  (is (str/starts-with? "abcde" "abc"))

  (is (not (str/starts-with? "abcde" "b")))
  (is (not (str/starts-with? "abcde" "bc")))

  (is (not (str/starts-with? "a" "ab")))
  (is (not (str/starts-with? "ab" "abc"))))