klyn.code.klyn.KlynDocComment.stripLineComment
method
public static stripLineComment(value as String) as String
Description

Strips a trailing # line comment from value while ignoring # characters inside string, character, or backtick literals.

Parameters
ParameterDescription
valueSource line text.
Returns

Line text prior to any unquoted # comment.

Example
import klyn.code.klyn

assert KlynDocComment.stripLineComment("x = \"#notacomment\" # comment").toTrim() == "x = \"#notacomment\""