I want to paste a string into a text area where the limit is 4000 chars. If the string is longer than 4000 then it should divide it. For ex. if length is 5000 then it should divide it into two parts (4000, 1000), if the length is 9000 then it should divide it into 3 parts (4000, 4000, 1000).
String does not have any specific separator, so it should divide from 0 - 4000, 4001 to 5000 and so on till its length in equal parts.
Can anyone help on this?