Author: zoltan
Date: 2005-03-24 12:14:32 -0500 (Thu, 24 Mar 2005)
New Revision: 42223

Modified:
   trunk/mcs/class/corlib/System/ChangeLog
   trunk/mcs/class/corlib/System/String.cs
Log:
2005-03-24  Zoltan Varga  <[EMAIL PROTECTED]>

        * String.cs: Add some 2.0 methods.


Modified: trunk/mcs/class/corlib/System/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System/ChangeLog     2005-03-24 16:22:49 UTC (rev 
42222)
+++ trunk/mcs/class/corlib/System/ChangeLog     2005-03-24 17:14:32 UTC (rev 
42223)
@@ -1,3 +1,7 @@
+2005-03-24  Zoltan Varga  <[EMAIL PROTECTED]>
+
+       * String.cs: Add some 2.0 methods.
+
 2005-03-24  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * Activator.cs: Now use the supplied evidences when loading 

Modified: trunk/mcs/class/corlib/System/String.cs
===================================================================
--- trunk/mcs/class/corlib/System/String.cs     2005-03-24 16:22:49 UTC (rev 
42222)
+++ trunk/mcs/class/corlib/System/String.cs     2005-03-24 17:14:32 UTC (rev 
42223)
@@ -663,6 +663,28 @@
                        return 
CultureInfo.CurrentCulture.CompareInfo.LastIndexOf (this, value, startIndex, 
count);
                }
 
+#if NET_2_0
+               public bool Contains (String value)
+               {
+                       return IndexOf (value) != -1;
+               }
+
+               public static bool IsNullOrEmpty (String value)
+               {
+                       return (value == null) || (value.Length == 0);
+               }
+
+               public string Remove (int startIndex)
+               {
+                       if (startIndex < 0)
+                               throw new ArgumentOutOfRangeException 
("startIndex", "StartIndex can not be less than zero");
+                       if (startIndex >= this.length)
+                               throw new ArgumentOutOfRangeException 
("startIndex", "StartIndex must be less than the length of the string");
+
+                       return Remove (startIndex, this.length - startIndex);
+               }
+#endif
+
                public String PadLeft (int totalWidth)
                {
                        return PadLeft (totalWidth, ' ');

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to