Method Reverse
Reverse(StringBuilder)
Causes this character sequence to be replaced by the reverse of the sequence. If there are any surrogate pairs included in the sequence, these are treated as single characters for the reverse operation. Thus, the order of the high-low surrogates is never reversed.
Let n
be the character length of this character sequence
(not the length in k
in the new character sequence is
equal to the character at index n-k-1
in the old
character sequence.
Note that the reverse operation may result in producing surrogate pairs that were unpaired low-surrogates and high-surrogates before the operation. For example, reversing "\uDC00\uD800" produces "\uD800\uDC00" which is a valid surrogate pair.
Declaration
public static StringBuilder Reverse(this StringBuilder text)
Parameters
Type | Name | Description |
---|---|---|
StringBuilder | text | this |
Returns
Type | Description |
---|---|
StringBuilder | a reference to this |