Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Strip-block-comments/C-sharp/strip-block-comments.cs
Normal file
18
Task/Strip-block-comments/C-sharp/strip-block-comments.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
|
||||
class Program
|
||||
{
|
||||
private static string BlockCommentStrip(string commentStart, string commentEnd, string sampleText)
|
||||
{
|
||||
while (sampleText.IndexOf(commentStart) > -1 && sampleText.IndexOf(commentEnd, sampleText.IndexOf(commentStart) + commentStart.Length) > -1)
|
||||
{
|
||||
int start = sampleText.IndexOf(commentStart);
|
||||
int end = sampleText.IndexOf(commentEnd, start + commentStart.Length);
|
||||
sampleText = sampleText.Remove(
|
||||
start,
|
||||
(end + commentEnd.Length) - start
|
||||
);
|
||||
}
|
||||
return sampleText;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue