-
Notifications
You must be signed in to change notification settings - Fork 195
Closed
Description
I encountered an unexpected behavior of str_trunc()
, here is a reprex of my problem.
In stringr v1.2.0 the result is as expected:
str_trunc(c('abcd', 'abcde', 'abcdef'), width = 5)
[1] "abcd" "abcde" "ab..."
In stringr v1.2.0.9000 the result not what one would unexpect:
str_trunc(c('abcd', 'abcde', 'abcdef'), width = 5)
[1] "abcd" "abcde" "abcdef"
And changing the order of the elements of the vector also impacts the output, which leads me to believe that the truncation is performed or not based on the number of characters in the first element of the vector of strings
str_trunc(c('abcdef', 'abcde', 'abcd'), width = 5)
[1] "ab..." "ab..." "ab..."
Metadata
Metadata
Assignees
Labels
No labels