Skip to content

Commit

Permalink
Extension also complete,
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixMathiasson committed Aug 12, 2024
1 parent a5399e7 commit 1387bda
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion csharp-fundamentals-strings.Main/Extension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ public StringBuilder two()
// 2. After adding the message, use an appropriate StringBuilder method to reverse it
// WRITE YOUR CODE BETWEEN THIS LINE...
sb.Append("Hello, world!");

string reverseString = "";
for(int i = sb.Length - 1; i >= 0 ; i--)
{
reverseString += sb[i];
}
sb.Clear();
sb.Append(reverseString);
// ...AND THIS LINE

return sb;
Expand Down

0 comments on commit 1387bda

Please sign in to comment.