Try with the attached xaml, I am splitting the strings into 250 characters lengh, you can change that variable size in the variable section to 4000 and then try with your string. The split output strings will be added into a collection.
till 4000 we cannot relybut can check this char count.
with more then 4000 char we can calculate the no of split with the integer division expressed with a backslash
for the length of the substring we do use the MOD (will give 0 for 4000,8000, x*4000) and do know how many chars we do have in the segment
Thanks for the solution, however if the 250th word is not a space then it will break the word and paste the other part in second iteration. In this string the last word is in first iteration is “of” if i changed it to “offset” then it will break the same and it will ignore the “off” and in second iteration it will paste the “set”.
So here can i check if the last 250th position if it is not a “space” then it should get the first part of string till one space before the last space position and then the remaining one in the next iteration.