Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

divide string in chunks c#

static IEnumerable<string> ChunksUpto(string str, int maxChunkSize) {
    for (int i = 0; i < str.Length; i += maxChunkSize) 
        yield return str.Substring(i, Math.Min(maxChunkSize, str.Length-i));
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# add to array 
Csharp :: c# bitmap to array byte 
Csharp :: shorthand if c# 
Csharp :: NET Framework 4.7.1 or a later update is already installed on this computer. 
Csharp :: c# iterate enum 
Csharp :: LINQ query to select top 5 
Csharp :: c# random sleep 
Csharp :: Convert array of strings to List<string 
Csharp :: validating file upload asp.net core mvc 
Csharp :: c# dictionary values to list 
Csharp :: c# isarray 
Csharp :: recursive reverse linked list 
Csharp :: byte array to base64 c# 
Csharp :: c# clear all textboxes 
Csharp :: datetime check null c# 
Csharp :: convert xml string to file c# 
Csharp :: change column name in datatable C# 
Csharp :: c# readline char 
Csharp :: C# using variables inside strings 
Csharp :: unity check if camera can see object 
Csharp :: orElseThrow 
Csharp :: c# datagridview select row right click 
Csharp :: c# excel close workbook 
Csharp :: unity c# change animation 
Csharp :: c# binary search 
Csharp :: c# #region #endregion 
Csharp :: c# html to pdf 
Csharp :: create new object from generic c# 
Csharp :: Winform on exit run method 
Csharp :: unity c# cos inverse 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =