Redactor.Redact Method

Definition

Overloads

Redact(ReadOnlySpan<Char>)

Redacts potentially sensitive data.

Redact(String)

Redacts potentially sensitive data.

Redact(ReadOnlySpan<Char>, Span<Char>)

Redacts potentially sensitive data.

Redact(String, Span<Char>)

Redacts potentially sensitive data.

Redact<T>(T, String, IFormatProvider)

Redacts potentially sensitive data.

Redact<T>(T, Span<Char>, String, IFormatProvider)

Redacts potentially sensitive data.

Redact(ReadOnlySpan<Char>)

Source:
Redactor.cs

Redacts potentially sensitive data.

C#
public string Redact(ReadOnlySpan<char> source);

Parameters

source
ReadOnlySpan<Char>

Value to redact.

Returns

Redacted value.

Applies to

.NET 10 (package-provided) und andere Versionen
Produkt Versionen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)

Redact(String)

Source:
Redactor.cs

Redacts potentially sensitive data.

C#
public virtual string Redact(string? source);

Parameters

source
String

Value to redact.

Returns

Redacted value.

Exceptions

source is null.

Remarks

Returns an empty string when source is null.

Applies to

.NET 10 (package-provided) und andere Versionen
Produkt Versionen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)

Redact(ReadOnlySpan<Char>, Span<Char>)

Source:
Redactor.cs

Redacts potentially sensitive data.

C#
public abstract int Redact(ReadOnlySpan<char> source, Span<char> destination);

Parameters

source
ReadOnlySpan<Char>

Value to redact.

destination
Span<Char>

Buffer to store redacted value.

Returns

Number of characters produced when redacting the given source input.

Exceptions

destination is too small.

Applies to

.NET 10 (package-provided) und andere Versionen
Produkt Versionen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)

Redact(String, Span<Char>)

Source:
Redactor.cs

Redacts potentially sensitive data.

C#
public int Redact(string? source, Span<char> destination);

Parameters

source
String

Value to redact.

destination
Span<Char>

Buffer to redact into.

Returns

Number of characters written to the buffer.

Exceptions

destination is too small.

Remarks

Returns 0 when source is null.

Applies to

.NET 10 (package-provided) und andere Versionen
Produkt Versionen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)

Redact<T>(T, String, IFormatProvider)

Source:
Redactor.cs

Redacts potentially sensitive data.

C#
public string Redact<T>(T value, string? format = default, IFormatProvider? provider = default);

Type Parameters

T

Type of value to redact.

Parameters

value
T

Value to redact.

format
String

The optional format that selects the specific formatting operation performed. Refer to the documentation of the type being formatted to understand the values you can supply here.

provider
IFormatProvider

Format provider used to produce a string representing the value.

Returns

Redacted value.

Exceptions

value is null.

Applies to

.NET 10 (package-provided) und andere Versionen
Produkt Versionen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)

Redact<T>(T, Span<Char>, String, IFormatProvider)

Source:
Redactor.cs

Redacts potentially sensitive data.

C#
public int Redact<T>(T value, Span<char> destination, string? format = default, IFormatProvider? provider = default);

Type Parameters

T

Type of value to redact.

Parameters

value
T

Value to redact.

destination
Span<Char>

Buffer to redact into.

format
String

The optional format string that selects the specific formatting operation performed. Refer to the documentation of the type being formatted to understand the values you can supply here.

provider
IFormatProvider

Format provider used to produce a string representing the value.

Returns

Number of characters written to the buffer.

Exceptions

value is null.

destination is too small.

Applies to

.NET 10 (package-provided) und andere Versionen
Produkt Versionen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)