public static stripLineComment(value as String) as String
Strips a trailing # line comment from value while ignoring # characters inside string, character, or backtick literals.
| Parameter | Description |
|---|---|
value | Source line text. |
Line text prior to any unquoted # comment.
import klyn.code.klyn
assert KlynDocComment.stripLineComment("x = \"#notacomment\" # comment").toTrim() == "x = \"#notacomment\""