diff --git a/src/NuGet.config b/src/NuGet.config index 2aeccd78e205..7f03e38b56d5 100644 --- a/src/NuGet.config +++ b/src/NuGet.config @@ -1,16 +1,15 @@ - + + + + - - - - diff --git a/src/System.Runtime/ref/System.Runtime.cs b/src/System.Runtime/ref/System.Runtime.cs index 5d12c0fa871a..70563b66f998 100644 --- a/src/System.Runtime/ref/System.Runtime.cs +++ b/src/System.Runtime/ref/System.Runtime.cs @@ -1617,6 +1617,11 @@ public void CopyTo(int sourceIndex, char[] destination, int destinationIndex, in public string ToUpper() { return default(string); } public string ToUpperInvariant() { return default(string); } public string Trim() { return default(string); } + public string TrimStart() { return default(string); } + public string TrimEnd() { return default(string); } + public string Trim(char trimChars) { return default(string); } + public string TrimStart(char trimChars) { return default(string); } + public string TrimEnd(char trimChars) { return default(string); } public string Trim(params char[] trimChars) { return default(string); } public string TrimEnd(params char[] trimChars) { return default(string); } public string TrimStart(params char[] trimChars) { return default(string); } diff --git a/src/System.Runtime/tests/System.Runtime.Tests.csproj b/src/System.Runtime/tests/System.Runtime.Tests.csproj index af90a05bbd58..b1d78db5686d 100644 --- a/src/System.Runtime/tests/System.Runtime.Tests.csproj +++ b/src/System.Runtime/tests/System.Runtime.Tests.csproj @@ -111,6 +111,11 @@ + + true + None + Never + false Content diff --git a/src/System.Runtime/tests/System/String.cs b/src/System.Runtime/tests/System/String.cs index 2a21e82d2acd..0c78f6f03214 100644 --- a/src/System.Runtime/tests/System/String.cs +++ b/src/System.Runtime/tests/System/String.cs @@ -1519,17 +1519,68 @@ public static void TestTrim() s = ". Foo .".Trim('.'); Assert.Equal(" Foo ", s); + s = "..Foo.".Trim('.'); + Assert.Equal("Foo", s); + + s = ".Foo .".Trim('.'); + Assert.Equal("Foo ", s); + s = " Foo ".TrimStart(); Assert.Equal("Foo ", s); s = ". Foo .".TrimStart('.'); Assert.Equal(" Foo .", s); + s = "..Foo.".TrimStart('.'); + Assert.Equal("Foo.", s); + + s = ".Foo .".TrimStart('.'); + Assert.Equal("Foo .", s); + s = " Foo ".TrimEnd(); Assert.Equal(" Foo", s); s = ". Foo .".TrimEnd('.'); Assert.Equal(". Foo ", s); + + s = "..Foo.".TrimEnd('.'); + Assert.Equal("..Foo", s); + + s = ".Foo .".TrimEnd('.'); + Assert.Equal(".Foo ", s); + + s = ". Foo .".Trim('.', 'F'); + Assert.Equal(" Foo ", s); + + s = ".Foo .".Trim('.', 'F'); + Assert.Equal("oo ", s); + + s = ".. FFoo .".TrimStart('.', 'F'); + Assert.Equal(" FFoo .", s); + + s = "..FFoo .".TrimStart('.', 'F'); + Assert.Equal("oo .", s); + + s = ".. FFoo ..".TrimEnd('.','o'); + Assert.Equal(".. FFoo ", s); + + s = ".. FFoo..".TrimEnd('.', 'o'); + Assert.Equal(".. FF", s); + + s = ".Foo .".Trim('.', 'F', 'x'); + Assert.Equal("oo ", s); + + s = ".. FFoo .".TrimStart('.', 'F', 'x'); + Assert.Equal(" FFoo .", s); + + s = ".. FFoo ..".TrimEnd('.', 'o', 'x'); + Assert.Equal(".. FFoo ", s); + + s = ".xFoo .".Trim('.', 'F', 'x'); + Assert.Equal("oo ", s); + + s = ".Fxoo .".Trim('.', 'F', 'x'); + Assert.Equal("oo ", s); } [Fact]