Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix casing in string extension #5

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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