Compare commits
2 Commits
105dadd798
...
fb91398462
Author | SHA1 | Date |
---|---|---|
|
fb91398462 | |
|
e87f19a8df |
|
@ -39,11 +39,12 @@ data class SelectCommunityPostResponse @QueryProjection constructor(
|
||||||
if (existOrdered) {
|
if (existOrdered) {
|
||||||
content
|
content
|
||||||
} else {
|
} else {
|
||||||
if (content.length > 15) {
|
val length = content.codePointCount(0, content.length)
|
||||||
|
if (length > 15) {
|
||||||
val endIndex = content.offsetByCodePoints(0, 15)
|
val endIndex = content.offsetByCodePoints(0, 15)
|
||||||
content.substring(0, endIndex).plus("...")
|
content.substring(0, endIndex).plus("...")
|
||||||
} else {
|
} else {
|
||||||
val endIndex = content.offsetByCodePoints(0, content.length / 2)
|
val endIndex = content.offsetByCodePoints(0, length / 2)
|
||||||
content.substring(0, endIndex).plus("...")
|
content.substring(0, endIndex).plus("...")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue