A @safe mutable string builder class for the D programming language, modeled after .NET's System.Text.StringBuilder. It provides efficient methods for appending, inserting, removing, and replacing strings, with support for numeric types, wide strings, interpolated expressions, and more.
The purpose of this project is to experiment with various text handling issues that will be encountered during the Phobos 3 development process.
- All major .NET StringBuilder API methods and properties
- Fluent interface (methods return
StringBuilder) - Comprehensive unit tests
- UTF-8, UTF-16, UTF-32 support
- Interpolated string support
import phobos.text.stringbuilder;
auto sb = new StringBuilder();
sb.append("Hello");
sb.append(" ");
sb.append("World");
assert(sb.toString() == "Hello World");sb.clear();
sb.append("Hello World");
sb.insert(5, "Beautiful ");
assert(sb.toString() == "Hello Beautiful World");
sb.remove(5, 9);
assert(sb.toString() == "Hello World");sb.replace("World", "Dlang");
assert(sb.toString() == "Hello Dlang");
sb.replace("Dlang", "D", 6, 5);
assert(sb.toString()