shorten function

Shorten long names

Shorten long names

Removes common prefixes and suffixes from character vectors. 1.0

Shorten(words)

Arguments

  • words: A character vector to be shortened.

Returns

The argument words is returned, after common prefixes and suffixes have been removed. If all arguments are identical then no shortening is done.

Author(s)

Steven L. Scott steve.the.bayesian@gmail.com

See Also

bsts.mixed.

Examples

Shorten(c("/usr/common/foo.tex", "/usr/common/barbarian.tex")) # returns c("foo", "barbarian") Shorten(c("hello", "hellobye")) # returns c("", "bye") Shorten(c("hello", "hello")) # returns c("hello", "hello") Shorten(c("", "x", "xx")) # returns c("", "x", "xx") Shorten("abcde") # returns "abcde"
  • Maintainer: Steven L. Scott
  • License: LGPL-2.1 | MIT + file LICENSE
  • Last published: 2024-01-17

Useful links