Update SimpleToolkit.Extensions/StringExtensions.cs
This commit is contained in:
@@ -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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user