tests/testthat/test-removeprefix.R

test_that("strs_removeprefix works", {
  expect_equal(strs_removeprefix("words", "wo"), "rds")
  expect_equal(strs_removeprefix("words", "rds"), "words")
  expect_equal(strs_removeprefix(rep("words", 2), "wo"), rep("rds", 2))
})

Try the strs package in your browser

Any scripts or data that you put into this service are public.

strs documentation built on Sept. 11, 2024, 6:44 p.m.