public static StringBuilder ReplaceWhiteSpaceWith(
this StringBuilder builder,
string? replacement,
int startIndex,
bool skipNewLines = false
)<ExtensionAttribute>
Public Shared Function ReplaceWhiteSpaceWith (
builder As StringBuilder,
replacement As String,
startIndex As Integer,
Optional skipNewLines As Boolean = false
) As StringBuilderpublic:
[ExtensionAttribute]
static StringBuilder^ ReplaceWhiteSpaceWith(
StringBuilder^ builder,
String^ replacement,
int startIndex,
bool skipNewLines = false
)[<ExtensionAttribute>]
static member ReplaceWhiteSpaceWith :
builder : StringBuilder *
replacement : string *
startIndex : 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 is less than zero or greater than the number of characters in builder. |