% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/20-api-generics.R
\name{split_at}
\alias{split_at}
\title{Split at a Position or Name}
\usage{
split_at(x, at, pull_index = FALSE)
}
\arguments{
\item{x}{A \code{flexseq}.}

\item{at}{A single positive integer position or a single character name.}

\item{pull_index}{Controls output shape:
\itemize{
\item \code{FALSE} (default): returns \code{list(left, value, right)}.
\item \code{TRUE}: returns \code{list(left, right)}.
}}
}
\value{
A split result with shape controlled by \code{pull_index}.
}
\description{
Splits by a single one-based position or a single element name.
}
\details{
\code{split_at(x, at, pull_index = FALSE)} is a convenience wrapper around
\code{\link[=split_around_by_predicate]{split_around_by_predicate()}} using positional scanning.

\code{split_at(x, at, pull_index = TRUE)} is the two-way variant using
\code{\link[=split_by_predicate]{split_by_predicate()}}.
}
\examples{
x <- flexseq("a", "b", "c", "d")
split_at(x, 3)
split_at(x, 3, pull_index = TRUE)

n <- flexseq(a = 1, b = 2, c = 3)
split_at(n, "b")
}
