Trying to split string in Clojure running into lazy seq problem

Mar*_*ins 1 clojure lazy-evaluation lazy-sequences

I am working on a problem to read in a file with lines like:

A abcdefg
B bcdefgh
Run Code Online (Sandbox Code Playgroud)

But I keep getting errors about Lazy Sequence not compatible with Java Charseq ..

I tried:

(def notlazy (doall lyne2))
Run Code Online (Sandbox Code Playgroud)

Then thought I verified:

(realized? notlazy)
true
Run Code Online (Sandbox Code Playgroud)

But still:

(str/split notlazy #" ")
ClassCastException class clojure.lang.LazySeq cannot be cast to class
  java.lang.CharSequence (clojure.lang.LazySeq is in unnamed module of
  loader 'app'; java.lang.CharSequence is in module java.base of loader
  'bootstrap')  clojure.string/split (string.clj:219)
Run Code Online (Sandbox Code Playgroud)

Help please!

Lee*_*Lee 6

The first argument to str/split must be a CharSequence to be split. Presumably you want to split each input line in the sequence for which you can use map without needing to eagerly evaluate the input sequence:

(map (fn [line] (str/split line #" ")) lyne2)
Run Code Online (Sandbox Code Playgroud)