public static StringBuilder ReplaceWhiteSpaceWith(
this StringBuilder builder,
ReadOnlySpan<char> replacement,
int startIndex,
int count,
bool skipNewLines = false
)<ExtensionAttribute>
Public Shared Function ReplaceWhiteSpaceWith (
builder As StringBuilder,
replacement As ReadOnlySpan(Of Char),
startIndex As Integer,
count As Integer,
Optional skipNewLines As Boolean = false
) As StringBuilderpublic:
[ExtensionAttribute]
static StringBuilder^ ReplaceWhiteSpaceWith(
StringBuilder^ builder,
ReadOnlySpan<wchar_t> replacement,
int startIndex,
int count,
bool skipNewLines = false
)[<ExtensionAttribute>]
static member ReplaceWhiteSpaceWith :
builder : StringBuilder *
replacement : ReadOnlySpan<char> *
startIndex : int *
count : int *
?skipNewLines : bool
(* Defaults:
let _skipNewLines = defaultArg skipNewLines false
*)
-> StringBuilder The method uses IsWhiteSpace(Char) to identify white space characters and works more thoroughly with it than Regex.Replace(string input, @"\s+", string replacement).
IsNewLine(Char) is used to identify newline characters.
| ArgumentNullException | builder is null. |
| ArgumentOutOfRangeException | startIndex or count are smaller than zero or larger than the number of characters in builder - or - startIndex + count is larger than the number of characters in builder. |