This message was deleted.
# announcements
s
This message was deleted.
p
Copy code
if (line.startsWith('/')) line.drop(1) else line
or
Copy code
line.let {
    if (it.startsWith('/')) it.drop(1) else it
}
s
but i want to retain the result of the original expression
so i can use it with
Copy code
if (line.startsWith('/')) {
                line.drop(1)
                val str = StringBuilder()
                val parser = Parser(line.toStack())
                // modify the following, pulled from "fun String.collapse(token: String, replaceWith: String): String"
                val t = parser.IsSequenceOneOrMany(" ")
                while (parser.peek() != null) {
                    if (t.peek()) {
                        t.pop()
                        str.append(replaceWith)
                    }
                    else str.append(parser.pop()!!)
                }
            }
but make the drop(1) part of the if expression itself