// // Summary: // Returns a copy of this string converted to lowercase. // // Returns: // A string in lowercase. public String ToLower(); // // Summary: // Returns a copy of this string converted to lowercase, using the casing rules // of the specified culture. // // Parameters: // culture: // An object that supplies culture-specific casing rules. // // Returns: // The lowercase equivalent of the current string. // // Exceptions: // T:System.ArgumentNullException: // culture is null. [TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] public String ToLower(CultureInfo culture); // // Summary: // Returns a copy of this System.String object converted to lowercase using the // casing rules of the invariant culture. // // Returns: // The lowercase equivalent of the current string. [TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] public String ToLowerInvariant();
// ...
// // Summary: // Returns a copy of this string converted to uppercase. // // Returns: // The uppercase equivalent of the current string. public String ToUpper(); // // Summary: // Returns a copy of this string converted to uppercase, using the casing rules // of the specified culture. // // Parameters: // culture: // An object that supplies culture-specific casing rules. // // Returns: // The uppercase equivalent of the current string. // // Exceptions: // T:System.ArgumentNullException: // culture is null. [TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] public String ToUpper(CultureInfo culture); // // Summary: // Returns a copy of this System.String object converted to uppercase using the // casing rules of the invariant culture. // // Returns: // The uppercase equivalent of the current string. [TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] public String ToUpperInvariant();
CPU: Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz
2.30GHz
RAM: 8.00GB (7.78 GB usable)
OS: Windows 7 Enterprise (Service Pack1)
64-bit
第1次:
1 2 3 4 5 6 7 8
line count: 101850 ReadString: 44ms line count: 101850 ToUpperTest: 104ms line count: 101850 ToUpperInvariantTest: 156ms line count: 101850 ToLowerTest: 220ms line count: 101850 ToLowerInvariantTest: 287ms WriteStrings: 403ms Press any key to continue . . .
第2次:
1 2 3 4 5 6 7 8
line count: 101850 ReadString: 36ms line count: 101850 ToUpperTest: 91ms line count: 101850 ToUpperInvariantTest: 139ms line count: 101850 ToLowerTest: 197ms line count: 101850 ToLowerInvariantTest: 262ms WriteStrings: 368ms Press any key to continue . . .
第3次
1 2 3 4 5 6 7 8
line count: 101850 ReadString: 29ms line count: 101850 ToUpperTest: 79ms line count: 101850 ToUpperInvariantTest: 125ms line count: 101850 ToLowerTest: 179ms line count: 101850 ToLowerInvariantTest: 237ms WriteStrings: 339ms Press any key to continue . . .