Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9f0d820

Browse files
authored
Merge pull requestneetcode-gh#3669 from NotADucc/2390
create 2390-removing-stars-from-a-string.cs
2 parentsfd1d112 +38d774e commit9f0d820

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
publicclassSolution
2+
{
3+
publicstringRemoveStars(strings)
4+
{
5+
varoutput=newStringBuilder(s.Length);
6+
7+
foreach(varchins)
8+
{
9+
if(ch=='*')
10+
{
11+
output.Length--;
12+
}
13+
else
14+
{
15+
output.Append(ch);
16+
}
17+
}
18+
19+
returnoutput.ToString();
20+
}
21+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp