I have a following string
string input = "A123 B12345 777"
The expected result as an array as below,
A123 B12345 777
But the actual result is
A123 B12345
In the below code, the substring is not getting the last value. The size of the last value is just 3 chars.
SplitString(input, 7)
private IEnumerable<string> SplitString(string str, int size)
{
return Enumerable.Range(0, str.Length / size)
.Select(i => str.Substring(i * size, size));
}
Thank you