© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
15 replies
Juliandyce

❔ Stringbuilder remove

i have problem with remove in the following program:
public class Program11
{
static void Main(string[] args)
{
StringBuilder sb = new StringBuilder("Hello World!", 50);
//"Hallo Welt! start String
//50 maximale Länge des Strings
sb.Append(" How are u?");
// string hinten anfügen
sb.AppendLine();
sb.AppendLine("I am fine!");
//string hinten anfügen zeilenumbruch
sb.Insert(0, ":) ");

Console.WriteLine(sb.ToString());
sb.Remove(9, 14);
Console.WriteLine(sb.ToString());
}
}
}
I wanna remove World witch should go from 9-14:
output before remove; 🙂 Hello World! How are u?
I am fine!

output after remove: 🙂 Hello u?
I am fine!
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ StringBuilder in C#
C#CC# / help
12mo ago
question about strings & stringbuilder!
C#CC# / help
2y ago
✅ My stringbuilder is skipping lines
C#CC# / help
3y ago
Appending to StringBuilder by Unicode code point?
C#CC# / help
11mo ago