Add parameterless overloads of TrimStart/TrimEnd (dotnet/coreclr#8834)
authorThiago Camargos Lopes <thica@microsoft.com>
Wed, 11 Jan 2017 19:12:22 +0000 (17:12 -0200)
committerJose Perez Rodriguez <joperezr@microsoft.com>
Wed, 11 Jan 2017 19:12:22 +0000 (11:12 -0800)
Add parameterless overloads of TrimStart/TrimEnd

Commit migrated from https://github.com/dotnet/coreclr/commit/f00766b583aea7c4ab7515233b2a5054d86f3555

src/coreclr/src/mscorlib/model.xml
src/coreclr/src/mscorlib/ref/mscorlib.cs
src/coreclr/src/mscorlib/src/System/String.Manipulation.cs

index 5e9a727..75846ae 100644 (file)
       <Member Name="Trim" />
       <Member Name="Trim(System.Char[])" />
       <Member Name="TrimEnd(System.Char[])" />
+      <Member Name="TrimEnd" />
       <Member Name="TrimStart(System.Char[])" />
+      <Member Name="TrimStart" />
       <Member MemberType="Property" Name="Chars(System.Int32)" />
       <Member MemberType="Property" Name="Length" />
       <Member Status="ImplRoot" Name="System.Collections.IEnumerable.GetEnumerator" />
index d5a5e96..3a8ca2d 100644 (file)
@@ -3309,7 +3309,9 @@ namespace System
         public System.String Trim() { throw null; }
         public System.String Trim(params char[] trimChars) { throw null; }
         public System.String TrimEnd(params char[] trimChars) { throw null; }
+        public System.String TrimEnd() { throw null; }
         public System.String TrimStart(params char[] trimChars) { throw null; }
+        public System.String TrimStart() { throw null; }
     }
     [System.Runtime.InteropServices.ComVisibleAttribute(true)]
     public abstract partial class StringComparer : System.Collections.Generic.IComparer<string>, System.Collections.Generic.IEqualityComparer<string>, System.Collections.IComparer, System.Collections.IEqualityComparer
index 194b4f8..51007ba 100644 (file)
@@ -1553,8 +1553,11 @@ namespace System
             }
             return TrimHelper(trimChars,TrimHead);
         }
-    
-    
+
+        // Removes a set of characters from the beginning of this string.
+        public String TrimStart() => TrimHelper(TrimHead);
+        
+
         // Removes a set of characters from the end of this string.
         public String TrimEnd(params char[] trimChars) {
             if (null==trimChars || trimChars.Length == 0) {
@@ -1562,6 +1565,10 @@ namespace System
             }
             return TrimHelper(trimChars,TrimTail);
         }
+        
+        // Removes a set of characters from the end of this string.
+        public String TrimEnd()=> TrimHelper(TrimTail);
+        
 
         // Trims the whitespace from both ends of the string.  Whitespace is defined by
         // Char.IsWhiteSpace.