Add ReadOnlySpan string-like StartsWith and EndsWith API with globalization support...
authorAhson Khan <ahkha@microsoft.com>
Wed, 14 Feb 2018 02:18:46 +0000 (18:18 -0800)
committerGitHub <noreply@github.com>
Wed, 14 Feb 2018 02:18:46 +0000 (18:18 -0800)
commit27af160a1d969c373894f1895c48fa43022f4aaa
tree70f6d9e3d628a67b0b616d513d358cb29f1167bb
parente6d3bd9f41e1dda82dc265dd091073b267d3ee3c
Add ReadOnlySpan string-like StartsWith and EndsWith API with globalization support (#16223)

* Add ReadOnlySpan string-like StartsWith API with globalization support

* Add ReadOnlySpan string-like EndsWith API with globalization support

* Fix nits from PR feedback.

* Address PR feedback

* Add unsafe keyword in CompareInfo.Unix methods.

* Address PR feedback and fix signature of Interop.Globalization.EndsWith

* Code formatting cleanup as suggested by VS.

* Revert "Code formatting cleanup as suggested by VS."

This reverts commit 20931fbf1ae113c6acaa3a4b2c0789b46d7ab06b.

* Creating Span specific methods and working around use of IsFastSort

* Code cleanup

* Improve performance by avoiding slicing and fix impl bug

* Remove commented out code and revert some calls to FindString

* Updating checks for Unix to mimic what IsFastSort does.

* Add length checks and include IsFastSort check within the loop

* Fix bounds checks to not include 0x80

* Call correct method when StringComparison is IgnoreCase.

* Update exception type in string compare to remain consistent
src/mscorlib/shared/Interop/Unix/System.Globalization.Native/Interop.Collation.cs
src/mscorlib/shared/System/Globalization/CompareInfo.cs
src/mscorlib/shared/System/Span.NonGeneric.cs
src/mscorlib/shared/System/StringSpanHelpers.cs
src/mscorlib/src/System/Globalization/CompareInfo.Unix.cs
src/mscorlib/src/System/Globalization/CompareInfo.Windows.cs
src/mscorlib/src/System/String.Comparison.cs