From ea08d0fb9eff6a0f8c408b0fb26419458726715f Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Wed, 20 Apr 2022 17:11:55 +0100 Subject: [PATCH] [ci skip] Use meaningful parameter names (#14) --- X10D/src/StringExtensions/StringExtensions.cs | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/X10D/src/StringExtensions/StringExtensions.cs b/X10D/src/StringExtensions/StringExtensions.cs index cd4eaa1..cd33e50 100644 --- a/X10D/src/StringExtensions/StringExtensions.cs +++ b/X10D/src/StringExtensions/StringExtensions.cs @@ -72,38 +72,38 @@ public static class StringExtensions /// /// Converts this string from one encoding to another. /// - /// The input string. - /// The input encoding. - /// The output encoding. + /// The input string. + /// The input encoding. + /// The output encoding. /// /// Returns a new with its data converted to - /// . + /// . /// /// - /// is + /// is /// - or - - /// is + /// is /// -or - /// is . + /// is . /// - public static string ChangeEncoding(this string str, Encoding from, Encoding to) + public static string ChangeEncoding(this string value, Encoding sourceEncoding, Encoding destinationEncoding) { - if (str is null) + if (value is null) { - throw new ArgumentNullException(nameof(str)); + throw new ArgumentNullException(nameof(value)); } - if (from is null) + if (sourceEncoding is null) { - throw new ArgumentNullException(nameof(from)); + throw new ArgumentNullException(nameof(sourceEncoding)); } - if (to is null) + if (destinationEncoding is null) { - throw new ArgumentNullException(nameof(to)); + throw new ArgumentNullException(nameof(destinationEncoding)); } - return str.GetBytes(from).ToString(to); + return value.GetBytes(sourceEncoding).ToString(destinationEncoding); } ///