is this condensable? ```if (expansion.length != 0)...
# announcements
s
is this condensable?
Copy code
if (expansion.length != 0)
    if (expansion.last().equals(' ')) return expansion.dropLast(1).toString()
return expansion.toString()
l
return if (expansion.isNotEmpty() && expansion.last() == ' ') expansion.dropLast(1).toString() else expansion.tostring()
r
If it would be allowed to strip multiple whitespaces on the end, then
expension.trimEnd()
s
ok
s
why are you calling
toString
?
l
+1 for
.trimEnd()
, I did not really consider the context
s
return
expansion.trimEnd().toString()
works ^-^
@Shawn A cus
expansion
is of type
StringBuilder
i
expansion.removeSuffix(" ")
👏 1