public static string ReplaceWhiteSpaceWith(
this string s,
string? replacement,
bool skipNewLines = false
)<ExtensionAttribute>
Public Shared Function ReplaceWhiteSpaceWith (
s As String,
replacement As String,
Optional skipNewLines As Boolean = false
) As Stringpublic:
[ExtensionAttribute]
static String^ ReplaceWhiteSpaceWith(
String^ s,
String^ replacement,
bool skipNewLines = false
)[<ExtensionAttribute>]
static member ReplaceWhiteSpaceWith :
s : string *
replacement : string *
?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. |