(class (class (class String)))
java.lang.Class
(. String valueOf 42)
"42"
(isa? String (type "foo"))
true
(= (type "foo") String)
true
(isa? (class "string") String)
true
(identical? String (.getClass ""))
true
(= (class "abc") String)
true
(= String (class "hello"))
true
(def edn {:content "Hello!", :type String})
#'user/edn
(vec (into-array String ["a" "b" "c"]))
["a" "b" "c"]
(-> "foo" .getBytes (->> (new String)))
"foo"
(let [new (constantly 1)] (new String))
""
(defn only-integer? [string] (try (.parseInt string) true (catch Exception e) false))
#'user/only-integer?
(defmacro defstring [string & rest] `(def ~(symbol string) ~@rest))
#'user/defstring
(isa? [String Integer] [Object Object])
true
(mapv class? [String "some string"])
[true false]
(let [String 1] (String. ""))
""
(seq "some string to parse")
(\s \o \m \e \space \s \t \r \i \n \g \space \t \o \space \p \a \r \s \e)
(println "&(println \"Clojurebot: I'm sorry, I didn't mean it. Friends?\")")
nil
"&(println \"Clojurebot: I'm sorry, I didn't mean it. Friends?\")\n"
(->> "foo" .getBytes (new String))
"foo"
(assert (= String (.getClass "Test")))
nil
(mapv class [String "a string"])
[java.lang.Class java.lang.String]
(macroexpand '(new String "foo"))
(new String "foo")
(require '[clojure.string :as string])
nil
(isa? [String Number] [Object Object])
true
(into [] (make-array String 4 10))
[#object ["[Ljava.lang.String;" 0x2e651d1b "[Ljava.lang.String;@2e651d1b"] #object ["[Ljava.lang.String;" 0x20a2e6a7 "[Ljava.lang.String;@20a2e6a7"] #object ["[Ljava.lang.String;" 0x249d766b "[Ljava.lang.String;@249d766b"] #object ["[Ljava.lang.String;" 0x619fec9c "[Ljava.lang.String;@619fec9c"]]
(instance? (class (into-array String [])) nil)
false
(println "Say I'm pretty! ##(printlin \"Even if I don't mean it?\")")
nil
"Say I'm pretty! ##(printlin \"Even if I don't mean it?\")\n"
(macroexpand-1 `(NGServer/main (into-array String addr-port)))
(NGServer/main (clojure.core/into-array java.lang.String user/addr-port))
(map (juxt identity class) [String ""])
([java.lang.String java.lang.Class] ["" java.lang.String])
(let [Long String] (instance? Long "abc"))
true
(type (with-meta {:a 1} {:type String}))
java.lang.String
(defn ^{:type String} foo [] "foo")
#'user/foo
(require '(clojure [string :as s]))
nil
(into [] (into [] (make-array String 4 10)))
[#object ["[Ljava.lang.String;" 0x2efb430e "[Ljava.lang.String;@2efb430e"] #object ["[Ljava.lang.String;" 0x2ac4d209 "[Ljava.lang.String;@2ac4d209"] #object ["[Ljava.lang.String;" 0x6fc64935 "[Ljava.lang.String;@6fc64935"] #object ["[Ljava.lang.String;" 0x2af4d2c5 "[Ljava.lang.String;@2af4d2c5"]]
(doseq [item (make-array String 20)] (println item))
nil
"nil\nnil\nnil\nnil\nnil\nnil\nnil\nnil\nnil\nnil\nnil\nnil\nnil\nnil\nnil\nnil\nnil\nnil\nnil\nnil\n"
(macroexpand-1 '(name-hash-factory String "a" "b" "c"))
(name-hash-factory String "a" "b" "c")
(merge `{~String 0} `{String 1})
{java.lang.String 0, java.lang.String 1}
(do (require '[clojure.string :as string]) :string/foo)
:string/foo
(macroexpand '(create String "a" "b" "c"))
(create String "a" "b" "c")
(filter (comp #{String} type) ["test" 1])
("test")
(.hashCode "This is where the long string would go")
-1611456038
(defn p [string] (for [mime-exts (.split string ",") [mime exts] [(.split mime-exts ";")]] [(keyword mime) exts]))
#'user/p
(map #(re-find #"^[^a]*$" %) ["this string contains an a" "this string does not"])
(nil "this string does not")
(str "With different sentences." "Like this." "And I'd like to get a space in between each string programmatically")
"With different sentences.Like this.And I'd like to get a space in between each string programmatically"
(type (seq (into-array String ["one" "two" "three"])))
clojure.lang.ArraySeq
(condp instance? 10 String :string Integer :integer :foo)
:foo
(map #(new String %) ["a" "b" "c"])
("a" "b" "c")
(def edn-str "{:content \"Hello!\" :type String}")
#'user/edn-str
(defmacro log [string] `(.info (Logger/getLogger "global") ~string))
#'user/log