public static string ReplaceWhiteSpaceWith(
this string s,
ReadOnlySpan<char> replacement,
bool skipNewLines = false
)<ExtensionAttribute>
Public Shared Function ReplaceWhiteSpaceWith (
s As String,
replacement As ReadOnlySpan(Of Char),
Optional skipNewLines As Boolean = false
) As Stringpublic:
[ExtensionAttribute]
static String^ ReplaceWhiteSpaceWith(
String^ s,
ReadOnlySpan<wchar_t> replacement,
bool skipNewLines = false
)[<ExtensionAttribute>]
static member ReplaceWhiteSpaceWith :
s : string *
replacement : ReadOnlySpan<char> *
?skipNewLines : bool
(* Defaults:
let _skipNewLines = defaultArg skipNewLines false
*)
-> string 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 | s is null. |