File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed
src/LinkDotNet.StringBuilder
tests/LinkDotNet.StringBuilder.UnitTests Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ All notable changes to **ValueStringBuilder** will be documented in this file. T
66
77## [ Unreleased]
88
9+ ### Added
10+ - Added ` Reverse ` function
11+
912## [ 1.12.2] - 2023-02-21
1013
1114### Changed
Original file line number Diff line number Diff line change @@ -287,6 +287,11 @@ public readonly void Dispose()
287287 }
288288 }
289289
290+ /// <summary>
291+ /// Reverses the sequence of elements in this instance.
292+ /// </summary>
293+ public readonly void Reverse ( ) => buffer [ ..bufferPosition ] . Reverse ( ) ;
294+
290295 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
291296 private void Grow ( int capacity = 0 )
292297 {
Original file line number Diff line number Diff line change @@ -468,4 +468,14 @@ public void ConcatShouldHandleNullValues()
468468
469469 ValueStringBuilder . Concat ( array ! ) . Should ( ) . Be ( string . Empty ) ;
470470 }
471+
472+ [ Fact ]
473+ public void ShouldReverseString ( )
474+ {
475+ using var builder = new ValueStringBuilder ( "Hello" ) ;
476+
477+ builder . Reverse ( ) ;
478+
479+ builder . ToString ( ) . Should ( ) . Be ( "olleH" ) ;
480+ }
471481}
You can’t perform that action at this time.
0 commit comments