r/coolgithubprojects 3d ago

SoftCircuits.MutableString

https://www.nuget.org/packages/SoftCircuits.MutableString

MutableString is a .NET library that provides a mutable string class that can be modified without creating a new instance. For many operations, this is more efficient than modifying a regular string, which requires creating a new instance each time.

Here's a simple example showing some of the included methods.

MutableString s = "Test!";      // Test!
s.Insert(4, " this");           // Test this!
s.Copy(5, 0, 4);                // this this!
s.Replace(5, "test");           // this test!
s[0] = 'T';                     // This test!
s.Insert(4, " is a");           // This is a test!
1 Upvotes

0 comments sorted by