Strip comments from a string: Difference between revisions
add Standard ML
No edit summary |
(add Standard ML) |
||
Line 1,758:
"apples, pears"
</pre>
=={{header|Standard ML}}==
Strips comments and trailing spaces.
<lang sml>val stripComment =
let
val notMarker = fn #"#" => false | #";" => false | _ => true
open Substring
in
string o dropr Char.isSpace o takel notMarker o full
end</lang>
=={{header|Tcl}}==
|