diff options
author | Erti-Chris Eelmaa <chriseelmaa@gmail.com> | 2017-02-14 16:35:16 +0000 |
---|---|---|
committer | Tarek Mahmoud Sayed <tarekms@microsoft.com> | 2017-02-14 08:35:16 -0800 |
commit | d0f8481cd42e58013879326871455586a86bec6e (patch) | |
tree | 39e51171f99801e56a9e167cd56dbb1ff4d40791 /src/corefx | |
parent | 3e7d8a5deb0cb761b848e0370e57cf64b283c4f4 (diff) | |
download | coreclr-d0f8481cd42e58013879326871455586a86bec6e.tar.gz coreclr-d0f8481cd42e58013879326871455586a86bec6e.tar.bz2 coreclr-d0f8481cd42e58013879326871455586a86bec6e.zip |
Add case-insensitive String.Replace overloads (#9316)
Added overloads for String.Replace so that they now accept
StringComparison and CultureInfo as input parameters.
Diffstat (limited to 'src/corefx')
-rw-r--r-- | src/corefx/System.Globalization.Native/collation.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/corefx/System.Globalization.Native/collation.cpp b/src/corefx/System.Globalization.Native/collation.cpp index f37211208e..a8c24e16ad 100644 --- a/src/corefx/System.Globalization.Native/collation.cpp +++ b/src/corefx/System.Globalization.Native/collation.cpp @@ -440,7 +440,8 @@ extern "C" int32_t GlobalizationNative_IndexOf( int32_t cwTargetLength, const UChar* lpSource, int32_t cwSourceLength, - int32_t options) + int32_t options, + int32_t* pMatchedLength) { static_assert(USEARCH_DONE == -1, "managed side requires -1 for not found"); @@ -455,6 +456,13 @@ extern "C" int32_t GlobalizationNative_IndexOf( if (U_SUCCESS(err)) { result = usearch_first(pSearch, &err); + + // if the search was successful, + // we'll try to get the matched string length. + if(result != USEARCH_DONE && pMatchedLength != NULL) + { + *pMatchedLength = usearch_getMatchedLength(pSearch); + } usearch_close(pSearch); } } |