namespace System.Globalization {
[Serializable]
-#if NET_2_0
[ComVisible(true)]
-#endif
public class StringInfo {
- public StringInfo()
+
+ public StringInfo () : this (string.Empty)
{
}
-#if NET_2_0
string s;
int length;
- public StringInfo(string str)
+ public StringInfo (string value)
{
- if (str == null)
- throw new ArgumentNullException ("str");
- String = str;
+ // Argument check in property
+ String = value;
}
[ComVisible (false)]
- public override bool Equals (object obj)
+ public override bool Equals (object value)
{
- StringInfo other = obj as StringInfo;
+ StringInfo other = value as StringInfo;
return other != null && s == other.s;
}
}
return s.Substring (start, idx - start);
}
-#endif
public static string GetNextTextElement(string str)
{
throw new ArgumentNullException("string is null");
}
-#if NET_2_0
if(index >= str.Length)
return 0;
if(index < 0)
-#else
- if(index < 0 || index >= str.Length)
-#endif
throw new ArgumentOutOfRangeException ("Index is not valid");
/* Find the next base character, surrogate