Skip to content

Commit f1dce8f

Browse files
authored
docs: Add a more precise description to the Ellipsis function to prevent misunderstanding. (#635)
Signed-off-by: mengxun <[email protected]>
1 parent a9a589c commit f1dce8f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1771,7 +1771,7 @@ str := lo.Capitalize("heLLO")
17711771

17721772
### Ellipsis
17731773

1774-
Trims and truncates a string to a specified length and appends an ellipsis if truncated.
1774+
Trims and truncates a string to a specified length **in bytes** and appends an ellipsis if truncated. If the string contains non-ASCII characters (which may occupy multiple bytes in UTF-8), truncating by byte length may split a character in the middle, potentially resulting in garbled output.
17751775

17761776
```go
17771777
str := lo.Ellipsis(" Lorem Ipsum ", 5)

0 commit comments

Comments
 (0)