Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​StringNormalizationExtensions

Assembly: System.Runtime

Inheritance: object → StringNormalizationExtensions

Provides extension methods to work with string normalization.

Methods

public static bool
IsNormalized​(string strInput)
Indicates whether the specified string is in Unicode normalization form C.
Returns <see langword="true" /> if <paramref name="value" /> is in normalization form C; otherwise, <see langword="false" /> .
public static bool
IsNormalized​(string strInput, NormalizationForm normalizationForm)
Indicates whether a string is in a specified Unicode normalization form.
Returns <see langword="true" /> if <paramref name="value" /> is in normalization form <paramref name="normalizationForm" /> ; otherwise, <see langword="false" /> .
normalizationForm A Unicode normalization form.
public static bool
IsNormalized​(ReadOnlySpan<​char> source, NormalizationForm normalizationForm = 1)
Determines whether the specified span of characters is in a normalized form.
Returns <see langword="true" /> if the specified span of characters is in a normalized form; otherwise, <see langword="false" /> .
source The span of characters to check.
normalizationForm The normalization form to use.
public static string
Normalize​(string strInput)
Normalizes a string to a Unicode normalization form C.
Returns A new string whose textual value is the same as <paramref name="value" /> but whose binary representation is in Unicode normalization form C.
public static bool
TryNormalize​(ReadOnlySpan<​char> source, Span<​char> destination, Int32& charsWritten, NormalizationForm normalizationForm = 1)
public static string
Normalize​(string strInput, NormalizationForm normalizationForm)
Normalizes a string to the specified Unicode normalization form.
Returns A new string whose textual value is the same as <paramref name="value" /> but whose binary representation is in the <paramref name="normalizationForm" /> normalization form.
normalizationForm The Unicode normalization form.
public static int
GetNormalizedLength​(ReadOnlySpan<​char> source, NormalizationForm normalizationForm = 1)
Gets the estimated length of the normalized form of the specified string in the <see cref="F:System.Text.NormalizationForm.FormC" /> .
Returns The estimated length of the normalized form of the specified string.
source The character span to get the estimated length of the normalized form.
normalizationForm The normalization form to use.
public bool
Equals​(object obj)
Inherited from object
Determines whether the specified object is equal to the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
obj The object to compare with the current object.
protected void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public int
GetHashCode​()
Inherited from object
Serves as the default hash function.
Returns A hash code for the current object.
public Type
GetType​()
Inherited from object
Gets the <see cref="T:System.Type" /> of the current instance.
Returns The exact runtime type of the current instance.
protected object
MemberwiseClone​()
Inherited from object
Creates a shallow copy of the current <see cref="T:System.Object" /> .
Returns A shallow copy of the current <see cref="T:System.Object" /> .
public string
ToString​()
Inherited from object
Returns a string that represents the current object.
Returns A string that represents the current object.