concept strtrim() in category R

This is an excerpt from Manning's book Exploring Data with R.
Finally, there is the strtrim() function. It operates quite a bit like the substr() function, with a few subtle differences. Whereas substr() has the start and stop arguments for defining the positions of the starting and ending character for all elements of a vector, strtrim() just has the width argument. That argument is analogous to stop in substr() except that width can be a numeric vector of character widths that apply to each element. Conceivably, we could supply a vector of width values that’s the same length as the character vector and expect the truncations to correspond to those widths. In Listing 8.14, we won’t do anything with the width argument of strtrim() other than supply the value of 80 and compare the output to that of substr() using the all.equal() function.
Listing 8.14 Using strtrim() to truncate strings, much like substr().
```{r strtrim_resto_reviews} all.equal(resto_reviews %>% substr(1, 80), resto_reviews %>% strtrim(80)) #A ```The all.equal() function compares the outputs of both function calls and determines whether they are all equivalent. In this case, the result is TRUE. Besides the variable width, what is different about strtrim() to justify its existence? It turns out that this function should be chosen over substr() if any character strings have double width characters (e.g., contains Chinese, Japanese, or Korean characters).