Last active
October 17, 2018 03:12
-
-
Save raveneer/e48e8f7c15e5b9fc3ee9e396d9870630 to your computer and use it in GitHub Desktop.
VK's C# Extensions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// split string with chunkSize, discard remainings | |
/// </summary> | |
public static class StringExtension | |
{ | |
public static IEnumerable<string> Split(this string str, int chunkSize) | |
{ | |
return Enumerable.Range(0, str.Length / chunkSize) | |
.Select(i => str.Substring(i * chunkSize, chunkSize)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment