fork(6) download
  1. stringA="a; b; c; d; e; f; g; h; i; j;"
  2. s <- "4"
  3. stringB <- sub(sprintf("^((?:[^;]*;){%s}).*", s), "\\1", stringA)
  4. stringB
  5. ## "a; b; c; d;"
Success #stdin #stdout 0.3s 22840KB
stdin
Standard input is empty
stdout
[1] "a; b; c; d;"