All notable changes to ValueStringBuilder will be documented in this file. The project adheres to Semantic Versioning.
3.4.1 - 2026-02-19
- Use correct culture (
CurrentCulture) when noFormatProvideris provided inAppendandInsertmethods.
3.4.0 - 2026-02-18
AppendandInsertcan haveFormatProvider. Reported by @SMAH1 in #276
3.3.0 - 2026-01-19
- Added
AppendInterpolatedStringHandlerto support zero-allocation string interpolation inAppendandAppendLinemethods.
3.2.0 - 2025-10-31
- Renamed
PadLeft(ReadOnlySpan<char>, int, char)andPadRight(ReadOnlySpan<char>, int, char)toAppendPadLeft(ReadOnlySpan<char>, int, char)andAppendPadRight(ReadOnlySpan<char>, int, char)respectively.
3.1.0 - 2025-10-31
- Added
PadLeft(ReadOnlySpan<char>, int, char)andPadRight(ReadOnlySpan<char>, int, char)methods to append padded strings without allocating additional memory (by @SMAH1 in #260)
3.0.0 - 2025-10-30
This is the v3 major release. The API is almost the same as in v2 - there is only a slight change in the Concat static helper method to reflect a less-boxed API.
- .NET 10.0 support
IndexOf,LastIndexOf, andContainsmethods now supportStringComparison
ValueStringBuilder.Concatusesparams ReadOnlySpan<T>to reduce boxing and improve performance.
2.4.1 - 2025-03-25
- Optimized
Replace(char, char)(by @Joy-less in #241) - Optimized
Replace(ReadOnlySpan<char>, ReadOnlySpan<char>)when both spans are length 1 (by @Joy-less in #241)
2.4.0 - 2025-02-21
- Added
ToString(int)(by @Joy-less in #239) - Added
AsSpan(int),AsSpan(int, int),AsSpan(Range)(by @Joy-less in #239)
- Optimized and simplified
Replace(by @Joy-less in #238) - Simplified
IndexOfandLastIndexOf(by @Joy-less in #238)
- Fixed
IndexOfandLastIndexOfallowing out-of-bounds index when the string to find is empty (by @Joy-less in #238)
2.3.1 - 2025-02-20
- Optimized when the internal buffer should grow. Fixed by @Aniobodo.
2.3.0 - 2025-02-16
- Added
Equals(ReadOnlySpan<char>, StringComparison)(by @Joy-less in #234)
- Improved
Equals(ReadOnlySpan<char>)(by @Joy-less in #234) - Added performance short-circuit when span is empty in
Append(ReadOnlySpan<char>),AppendSpan(int),Insert(int, ReadOnlySpan<char>)in #233 (by @Joy-less)
2.2.0 - 2025-01-25
- Added
TrimPrefix(ReadOnlySpan<char>, StringComparison)(by yours truly (@Joy-less) in #226) - Added
TrimSuffix(ReadOnlySpan<char>, StringComparison)(also by yours truly (@Joy-less) in #226) - Added
Insert(int, char)overload (by yours truly (@Joy-less) in #225) - Added
Insert(int, Rune)overload (again by yours truly (@Joy-less) in #225) - Added
Replace(Rune, Rune)overload (see yours truly (@Joy-less) in #225) - Improved
Replace(scoped ReadOnlySpan<char>, scoped ReadOnlySpan<char>, int, int)fallback (achieved by yours truly (@Joy-less) in #225)
2.1.0 - 2025-01-14
- Added
Replace(Rune, Rune)overload - Added
Replace(Rune, Rune, int, int)overload
2.0.0 - 2025-01-12
This is the v2 release of the ValueStringBuilder. There aren't any noticeable breaking changes. Only old framework versions were removed to make further development easier. The API is the same (with new additions) as in v1.
- Added
Append(Rune)overload - Added
AppendJoin(Rune, IEnumerable<string?>)overload - Added
AppendJoin<T>(Rune, IEnumerable<T>)overload
- Support for
net6.0andnet7.0was removed.
- Added
OverloadResolutionPriorityforSpanoverload for the ctor to keep the current behavior. Reported by [@nsentinel])(https://github.com/nsentinel) in #210. - Optimised
AppendLine(scoped ReadOnlySpan<char>)by avoiding allocating a new string - Removed erroneous null check in
AppendJoin<T>(ReadOnlySpan<char>, IEnumerable<T>)
1.22.0 - 2024-12-18
AppendSpanmethod
1.21.1 - 2024-11-08
Append(bool)is now 33% faster
1.21.0 - 2024-09-20
PadLeftandPadRightmethods
1.20.0 - 2024-05-02
- New ctor that accepts an initial size
1.19.1 - 2024-04-19
- Some smaller refactorings
1.19.0 - 2024-03-02
- Support for
net9.0 - New
Appendoverload that accepts a single character
1.18.6 - 2023-11-03
Disposeresets theValueStringBuilderto the initial state, so it doesn't lead to undefined behavior when used again- Use different approach for
Growto be a bit more performant
1.18.5 - 2023-10-19
- Fixed a bug, where in
Appendoverflows the internal buffer and throws an exception - Use better struct layout to be more cache friendly
1.18.4 - 2023-10-14
- Optimized
Append(scoped ReadOnlySpan<char>)to be roughly 5% faster - Optimized
AppendLineto have less overhead
1.18.3 - 2023-09-22
- Enumerator.MoveNext is now a bit faster
1.18.2 - 2023-09-08
- Small refactoring to make the Enumerator.Current readonly
1.18.1 - 2023-08-10
- Fixed
IndexOutOfRangeExceptionissue when the remaining text length is shorter than the search term
1.18.0 - 2023-06-08
- Added custom enumerator to
ValueStringBuilderso it can be used inforeachloops
1.17.0 - 2023-04-13
- Support for
net8.0
1.16.0 - 2023-03-28
- New overloads for
Trim,TrimStartandTrimEndthat accept a character as parameter
1.15.0 - 2023-03-26
- New
Trim,TrimStartandTrimEndmethods
1.14.0 - 2023-03-25
- New overload for
Appendthat accepts aReadOnlyMemoryobject - New
ToStringoverload that accepts aRangeobject
- Improvements for
Appendwhen the type is a boolean
1.13.1 - 2023-03-17
- Remove unused defensive check in
EnsureCapacity
1.13.0 - 2023-03-04
- Added
Reversefunction
- Fixed a bug where two empty strings return the wrong value in (Last)IndexOf
1.12.2 - 2023-02-21
- Fixed CI/CD pipeline
1.12.1 - 2023-02-21
- Remove redundant null check when using
AppendJoin
1.12.0 - 2023-01-09
- Two more overloads for
AppendFormatfor up to 5 generic arguments
1.11.5 - 2023-01-09
- Added SourceLink so that pdbs are delivered as well - Attempt 2
1.11.4 - 2023-01-07
- Added SourceLink so that pdbs are delivered as well
1.11.3 - 2023-01-03
- Remove StringSyntaxAttribute to be public
1.11.2 - 2023-01-03
- Compiler hints for new
AppendFormatmethods
1.11.1 - 2023-01-01
- Refactored
AppendFormatto be faster especially for longer text.
1.11 - 2023-01-01
- New
AppendFormatfunctions (with 1 to 3 arguments).
1.10.6 - 2022-12-30
- Appending value types is roughly 10% faster
1.10.5 - 2022-12-29
- When growing only copy written content to the new buffer and safe some bytes
1.10.4 - 2022-12-27
- Fixed an issue with
LastIndexOfwhere it could run out of bounds
1.10.3 - 2022-12-26
- Fixed a bug where
Replacedoes something wrong
1.10.2 - 2022-12-16
- Additional null check in static
Concat
- Smaller refactoring
1.10.1 - 2022-11-28
- Minor changes and hints for the JIT
1.10.0 - 2022-11-20
Append(char* value, int length)overload.
- Better exception when appending
ISpanFormattableand buffer is not large enough.
1.9.0 - 2022-11-18
- Added
Equals(ReadOnlySpan<char>)overload
- Slight improvement when appending nullable types to the string builder
1.8.0 - 2022-11-15
- implicit cast operator from
stringandReadOnlySpan<char>to theValueStringBuilderwith pre-initialized buffer
- various path optimizations for replace logic to use less allocations while being faster
- Removed value type overloads for
AppendandInsertand just offerAppend(ISpanFormattable)andInsert(ISpanFormattable), which covers more cases.
1.7.0 - 2022-11-12
ToString(startIndex, length)to get a substring from the builderAppend(Guid guid)andInsert(Guid guid)as new overload- Added optional format string for
AppendandInsert
1.6.2 - 2022-11-11
- Slight improvements for
IndexOfmethods
- Some of the exception had the wrong order (message and parameter name)
1.6.1 - 2022-11-11
- Added
net7.0target
- Updated docs
1.6.0 - 2022-11-10
- Added overload which allows an initial string for the ValueStringBuilder
- Meziantou.Analyzer as developer dependency to spot issues early on
readonlyhint's on readonly methods
- Added
StructLayout(LayoutKind.Auto), which makes the ValueStringBuilder not usable for unmanaged code
1.5.1 - 2022-11-05
- Hot paths for strings
1.5.0 - 2022-11-05
- New easy API for concatenating smaller strings or objects via
ValueStringBuilder.Concat("Hello", " ", "World"); - Smaller performance improvements in internal API's
1.4.1 - 2022-11-04
- Smaller internal API improvements
- Smaller performance improvements
1.4.0 - 2022-10-11
- Added the
scopedkeyword to simplify code and allow more scenarios for the user
Growallowed values, which would truncate the internally represented string
1.3.0 - 2022-07-25
- Fixed an issue where memory is not returned to the ArrayPool
- Fixed an issue where memory could be overwritten, giving the chance to tamper with the internal array
1.2.0 - 2022-04-20
ValueStringBuilderconstructor can take initial buffer instead of creating it itself.- More compiler hints for inlining.
1.1.0 - 2022-04-16
Containsmethod.
- Smaller tweaks in CI/CD
IndexOfandLastIndexOfdid not return 0 when passing an empty string. Now it is aligned tostring.IndexOf.
- Debug symbol package (snupkg) due to the many constraints of NuGet.org
1.0.1 - 2022-04-13
- Enabled some optimization hints for the compiler.
- Include debug symbols when publishing to NuGet for easier debugging experience
1.0.0 - 2022-04-12
LastIndexOfto find the last occurence in the represented string.ReplaceGeneric<T>added for generic replacement in the string builder. Can have performance / allocation penalties in comparison to the non-generic version.
0.9.5 - 2022-04-10
IndexOfmethods to retrieve the index of the first occurence of a word.Capacityto give the user an indication if the internal array will grow soon.EnsureCapacityto set the buffer size to avoid re-allocation in a hot path.
- Some methods throw the wrong exception. When an index is "invalid" then a
ArgumentOutOfRangeexception is thrown.
0.9.4 - 2022-04-09
- Added
AppendJoinmethods.
0.9.3 - 2022-04-09
- Added
Replacemethods which also tries to have the least amount of allocations. - Added
GetPinnableReferencewhich allows to get the content via thefixedkeyword.
0.9.2 - 2022-04-06
- Added
RemoveandInsertmethods.
0.9.1 - 2022-04-06
This release brings extensions to the ValueStringBuilder API. For v1.0 the ValueStringBuilder tries to be en par with theSystem.Text.StringBuilder.
- Added extension method for
System.Text.StringBuilderto transform intoValueStringBuilderwithout additional allocation and the other way around. - Added
Lengthreadonly property which gives the length of the represented length. AddedClearto set theValueStringBuilderto the initial point.
- Initial release