This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +3
-30
lines changed
src/System.Private.CoreLib/shared/System/Globalization Expand file tree Collapse file tree 2 files changed +3
-30
lines changed Original file line number Diff line number Diff line change @@ -2407,35 +2407,8 @@ internal void GetNFIValues(NumberFormatInfo nfi)
2407
2407
2408
2408
// Helper
2409
2409
// This is ONLY used for caching names and shouldn't be used for anything else
2410
- internal static string AnsiToLower ( string testString )
2411
- {
2412
- int index = 0 ;
2413
-
2414
- while ( index < testString . Length && ( testString [ index ] < 'A' || testString [ index ] > 'Z' ) )
2415
- {
2416
- index ++ ;
2417
- }
2418
- if ( index >= testString . Length )
2419
- {
2420
- return testString ; // we didn't really change the string
2421
- }
2422
-
2423
- StringBuilder sb = new StringBuilder ( testString . Length ) ;
2424
- for ( int i = 0 ; i < index ; i ++ )
2425
- {
2426
- sb . Append ( testString [ i ] ) ;
2427
- }
2428
-
2429
- sb . Append ( ( char ) ( testString [ index ] - 'A' + 'a' ) ) ;
2430
-
2431
- for ( int ich = index + 1 ; ich < testString . Length ; ich ++ )
2432
- {
2433
- char ch = testString [ ich ] ;
2434
- sb . Append ( ch <= 'Z' && ch >= 'A' ? ( char ) ( ch - 'A' + 'a' ) : ch ) ;
2435
- }
2436
-
2437
- return ( sb . ToString ( ) ) ;
2438
- }
2410
+ internal static string AnsiToLower ( string testString ) =>
2411
+ TextInfo . ToLowerAsciiInvariant ( testString ) ;
2439
2412
2440
2413
/// <remarks>
2441
2414
/// The numeric values of the enum members match their Win32 counterparts. The CultureData Win32 PAL implementation
Original file line number Diff line number Diff line change @@ -451,7 +451,7 @@ private unsafe string ChangeCaseCommon<TConversion>(string source) where TConver
451
451
}
452
452
}
453
453
454
- private static unsafe string ToLowerAsciiInvariant ( string s )
454
+ internal static unsafe string ToLowerAsciiInvariant ( string s )
455
455
{
456
456
if ( s . Length == 0 )
457
457
{
You can’t perform that action at this time.
0 commit comments