namespace System.Unicode { /// Contains extension methods applicable to the type. public static class StringExtensions { /// Encapsulates the string in an object which can be used to enumerate code points. /// /// The enumerable returned by this method enumerates code points in a strict manner. /// If the string contains lone surrogates, the enumeration will throw. /// /// The string to encapsulate. /// An enumerable object, which can be used to enumerate code points in the string. public static CodePointEnumerable AsCodePointEnumerable(this string s) { return new CodePointEnumerable(s); } /// Encapsulates the string in an object which can be used to enumerate code points in a permissive way. /// /// The enumerable returned by this method is permissive, regarding the code points represented. /// It allows invalid sequences, such as lone surrogates, the enumeration will handle those gracefully. /// /// The string to encapsulate. /// An enumerable object, which can be used to enumerate code points in the string. public static PermissiveCodePointEnumerable AsPermissiveCodePointEnumerable(this string s) { return new PermissiveCodePointEnumerable(s); } } }