Strip block comments: Difference between revisions

Improve definition of task with more explanatory text. Make varying the delimiters an “extra credit” extension. No change to whether existing solutions satisfy the task or not.
m (Fix spelling in the sample…)
(Improve definition of task with more explanatory text. Make varying the delimiters an “extra credit” extension. No change to whether existing solutions satisfy the task or not.)
Line 1:
{{task}}A block comment begins with a ''beginingbeginning delimiter'' and ends with a ''ending delimiter'', including the delimiters. These delimiters are often multi-character sequences.
'''Task :'''
Strips block comments from text (of codes). Your demos should at least handle simple, non-nested and multiline block comment delimiters.
 
'''Task:''' Strip block comments from program text (of a programming language much like classic [[C]]). Your demos should at least handle simple, non-nested and multiline block comment delimiters. The beginning delimiter is the two-character sequence “<tt>/*</tt>” and the ending delimiter is “<tt>*/</tt>”.
Sample text for striping.
 
<pre> /**
Sample text for striping.stripping:
<pre> /**
/**
* Some comments
* longer comments here that we can parse.
Line 19 ⟶ 20:
*/
function something() {
}</pre>
</pre>
 
'''Extra credit:''' Ensure that the stripping code is not hard-coded to the particular delimiters described above, but instead allows the caller to specify them. (If your language supports them, [[Optional parameters|optional parameters]] may be useful for this.)
 
=={{header|D}}==
Anonymous user