Update SimpleToolkit.Extensions/StringExtensions.cs
Some checks failed
Build and publish app / Build (push) Successful in 18s
Build and publish app / Determine version (push) Successful in 15s
Build and publish app / Pack (push) Successful in 20s
Build and publish app / Publish (push) Failing after 11s

This commit is contained in:
2026-02-14 23:27:54 +01:00
Unverified
parent a526335259
commit 01a5981187

View File

@@ -8,17 +8,9 @@ namespace SimpleToolkit.Extensions
{ {
public static class StringExtensions public static class StringExtensions
{ {
#region STATIC
public static string CreateRandom(int length) => CreateRandom(length, "QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890`~!@#$%^&*()-_=+[{]};:'\"\\|,<.>/?"); public static string CreateRandom(int length) => CreateRandom(length, "QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890`~!@#$%^&*()-_=+[{]};:'\"\\|,<.>/?");
public static string CreateRandom(int length, IEnumerable<char> characters) => new string(Enumerable.Repeat(characters, length).Select(s => s.ElementAt(Random.Shared.Next(s.Count()))).ToArray()); public static string CreateRandom(int length, IEnumerable<char> characters) => new string(Enumerable.Repeat(characters, length).Select(s => s.ElementAt(Random.Shared.Next(s.Count()))).ToArray());
#endregion
#region INSTANCE
public static string Shuffle(this string instance) public static string Shuffle(this string instance)
{ {
char[] array = instance.ToCharArray(); char[] array = instance.ToCharArray();
@@ -34,7 +26,5 @@ namespace SimpleToolkit.Extensions
} }
return new string(array); return new string(array);
} }
#endregion
} }
} }