Change string chop method default to use smaller ... instead
This commit is contained in:
parent
28f222a5e6
commit
43b42f8d54
1 changed files with 1 additions and 1 deletions
|
@ -21,7 +21,7 @@ import kotlin.math.floor
|
|||
* Replaces the given string to have at most [count] characters using [replacement] at its end.
|
||||
* If [replacement] is longer than [count] an exception will be thrown when `length > count`.
|
||||
*/
|
||||
fun String.chop(count: Int, replacement: String = "..."): String {
|
||||
fun String.chop(count: Int, replacement: String = "…"): String {
|
||||
return if (length > count) {
|
||||
take(count - replacement.length) + replacement
|
||||
} else {
|
||||
|
|
Reference in a new issue