std-string-remove-comments


Synopsis

(std-string-remove-comments <str>)

Description

STD-STRING-REMOVE-COMMENT removes lisp like comments from strings, to allow comments in data files which could be read by a lisp evaluator. read would skip comments too but not all data files must follow a lisp syntax, but should allow comments.

Nested inline comments (;| xx;|xx|;|;) are not allowed, but inline comments inside ";" (; xx ;||;) are. It is not defined yet if the function throws an error on nested inline comments or returns a result which may be correct or wrong.

Examples

(std-string-remove-comment ";;; test   ") => ""
(std-string-remove-comment "(setq test nil) ; test") 
	=> "(setq test nil) "
(std-string-remove-comment "(setq ;|test_var|;test nil) ; test") 
	=> "(setq test nil) "

Arguments

str: a string.

Return Value

A string.

Side Effects

None.

Module

(std-require 'STDSTR)

Defined in STDSTR