IsNormalized() method is used to check whether the given string is in a particular Unicode normalization form or not. If the given string is in the particular normalized form, then this method returns true. Otherwise, return false.
There are two methods in the overload list of this method as follows:
- Some Unicode characters have multiple equivalent binary representations which complicate the searching, sorting, matching and other operations.
- The Unicode standard defines a process termed as normalization which returns one binary representation when given any of the equivalent binary representations of a character. Normalization can be performed with several algorithms, called normalization forms, that obey different rules.
- .NET currently supports normalization forms C, D, KC, and KD.
This method is used to check whether the given string is in Unicode normalization form C or not. If the string is in Unicode normalized form C then this method return true, otherwise false.
public bool IsNormalized ();
Return Value: The return type of this method is System.Boolean. This method returns true when the given string is in normalization form C and return false when the given string is not in the normalization form i.e C.
Exception: If the current instance contains invalid Unicode characters, then this method will give ArgumentException.
String is : Hello, Geeks! Is str1 string is in normalized form?: True
Note: The IsNormalized method returns false as it will come across the first non-normalized character in a string. So, if a string contains non-normalized characters followed by invalid Unicode characters, the Normalize method will throw an ArgumentException although IsNormalized returns false.
This method is used to check whether the given string is in the specified Unicode normalization form or not. If the given string is in specified Unicode normalization form then this method will return true, ortherwise false.
public bool IsNormalized (NormalizationForm nform);
Here, nform is a Unicode normalization form.
Return Value: The return type of this method is System.Boolean. This method returns true if this string is in the normalization form specified by the nform parameter. Otherwise, returns false.
Exception: This method will give ArgumentException if the current instance contains invalid Unicode characters.
Is string str1 is normalized to form C - True Is string str1 is normalized to form D - True Is string str1 is normalized to form KC - True Is string str1 is normalized to form KD - True
- Difference between Method Overriding and Method Hiding in C#
- Extension Method in C#
- C# | IndexOfAny() Method
- C# | Dictionary.Add() Method
- C# | Uri.GetHashCode() Method
- C# | Join Method | Set - 2
- C# | Math.Exp() Method
- C# | StartsWith() Method
- C# | PadRight() Method
- C# | Method Overloading
- C# | Math.Pow() Method
- DateTime.Add() Method in C#
- Queue.Contains() Method in C#
- C# | Uri.IsWellFormedOriginalString() Method
- C# | EndsWith() Method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.