Merge pull request #913 from Daniel15/fix-catchall-routing-master
[mono.git] / mcs / class / corlib / System.Globalization / StringInfo.cs
index e0621b72f163445fdc6af16cd4b2c68b02423a8b..8353bf87a350d58782bde97b44ca8c3f3f5ea3a7 100644 (file)
@@ -37,29 +37,26 @@ using System.Runtime.InteropServices;
 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;
                }
 
@@ -123,7 +120,6 @@ namespace System.Globalization {
                        }
                        return s.Substring (start, idx - start);
                }
-#endif
 
                public static string GetNextTextElement(string str)
                {
@@ -145,13 +141,9 @@ namespace System.Globalization {
                                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