Skip to content

Commit

Permalink
chore: fix casing in string extension
Browse files Browse the repository at this point in the history
"Alphanumeric" is a one word and so "n" shouldn't be uppercased
  • Loading branch information
lupusbytes committed Aug 21, 2024
1 parent 7768443 commit 39a82f5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/Atc.Kusto/Extensions/Internal/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ internal static partial class StringExtensions
/// <returns>A <see cref="Regex"/> instance that can be used to replace non-alphanumeric characters.</returns>

[GeneratedRegex("[^a-zA-Z0-9]", RegexOptions.Singleline, 1000)]
private static partial Regex AlphaNumericRegex();
private static partial Regex AlphanumericRegex();

/// <summary>
/// Removes all non-alphanumeric characters from the input string, leaving only letters and digits.
/// This method uses a source-generated regular expression for efficient processing.
/// </summary>
/// <param name="str">The input string to be filtered.</param>
/// <returns>A new string containing only alphanumeric characters from the input string.</returns>
public static string ToAlphaNumeric(
public static string ToAlphanumeric(
this string str)
=> AlphaNumericRegex().Replace(str, string.Empty);
=> AlphanumericRegex().Replace(str, string.Empty);
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public ExistingPagedStoredQueryHandler(
return null;
}

var queryId = split[0].ToAlphaNumeric();
var queryId = split[0].ToAlphanumeric();

if (!long.TryParse(split[1], GlobalizationConstants.EnglishCultureInfo, out var itemsReturned))
{
Expand Down
2 changes: 1 addition & 1 deletion src/Atc.Kusto/Providers/Internal/QueryIdProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public string Create(

return string
.Concat(queryType.Name, finalSessionId)
.ToAlphaNumeric();
.ToAlphanumeric();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void ToAlphaNumeric_ShouldRemoveNonAlphanumericCharacters(
string expected)
{
// Arrange & Act
var actual = input.ToAlphaNumeric();
var actual = input.ToAlphanumeric();

// Assert
Assert.Equal(expected, actual);
Expand All @@ -34,7 +34,7 @@ public void ToAlphaNumeric_ShouldReturnEmptyString_WhenInputIsEmpty()
var input = string.Empty;

// Act
var actual = input.ToAlphaNumeric();
var actual = input.ToAlphanumeric();

// Assert
Assert.Equal(string.Empty, actual);
Expand Down

0 comments on commit 39a82f5

Please sign in to comment.