Skip to main content

split-at-pos

function

rewrite-clj.paredit/split-at-pos

(split-at-pos [zloc pos])
In-string aware split. Returns `zloc` with node found at `pos` split. If `pos` is inside a string, splits string into two strings else calls [[split]]. - `zloc` location is (inclusive) starting point for `pos` depth-first search - `pos` can be a `{:row :col}` map or a `[row col]` vector. The `row` and `col` values are 1-based and relative to the start of the source code the zipper represents. Throws if `zloc` was not created with [position tracking](/doc/01-user-guide.adoc#position-tracking). - `[1 2 |3 4 5] => [1 2 |3] [4 5]` - `("Hello |World") => (|"Hello" "World")`

No examples yet. Be the first to add one!