Description Usage Arguments Value Examples
Remove trailing white spaces (or other character) from a string
1 | removeTrail(str, before = TRUE, after = TRUE, char = " ")
|
str |
character string to be trimmed |
before |
a logical which indicates whether to remove the character from the beginning of the string |
after |
a logical which indicates whether to remove the character from the end of the string |
char |
the character to be removed |
Returns a string from which the character specified has been removed.
If the argument char
is not specified, then this will be trailing
white spaces.
1 2 3 4 5 | str <- " this is a test "
x <- removeTrail(str, before = TRUE)
x <- removeTrail(str, after = TRUE)
x <- removeTrail(str, before = TRUE, after = TRUE)
x <- removeTrail(str, before = TRUE, char = " th")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.