public static partial class CrefCache
A cache of different cref
conversions.
public static string AsCref(this string self)
Converts the given string into the format of cref
attribute value.
In the following example, the "Some<T1, T2>"
string
(which represents the name of some type)
is converted into "Some{T1,T2}"
as if it was a value of a link
(e.g., ):
var a = "Some<T1, T2>";
var b = a.AsCref();
<br/>
b.Should().Be("Some{T1,T2}");
public static string AsRawCref(this string self)
Converts the given string into the format of cref
attribute value
but also removes all generic parameter names.
In the following example, the "Some<T1, T2>"
string
(which represents the name of some type)
is converted into "Some{,}"
, the raw form of cref
that can be used for comparisons
without involving generic type parameter names.
var a = "Some<T1, T2>";
var b = a.AsCref();
<br/>
b.Should().Be("Some{,}");
public static string FromCref(this string self)
Converts the given string from the format of cref
attribute value.
In the following example, the "Some{T1,T2}"
string
(which represents the name of some type in the cref
format)
is converted into "Some<T1, T2>
so that it can be displayed somewhere.
var a = "Some{T1,T2}";
var b = a.AsCref();
<br/>
b.Should().Be("Some<T1, T2>");