(phixonline)--> with javascript_semantics function strip_comments(string s, sequence comments={"#",";"}) for i=1 to length(comments) do integer k = match(comments[i],s) if k then s = s[1..k-1] s = trim_tail(s) end if end for return s end function ?strip_comments("apples, pears # and bananas") ?strip_comments("apples, pears ; and bananas") ?strip_comments("apples, pears and bananas ") ?strip_comments(" WS_CAPTION = #00C00000, -- = WS_BORDER+WS_DLGFRAME") ?strip_comments(" WS_CAPTION = #00C00000, -- = WS_BORDER+WS_DLGFRAME",{"--"}) ?strip_comments(" title = \"--Title--\"",{"--"})