Divide string

HI Team,

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?


Hi @MaheshShelke

Check this

Ashwin S

@MaheshShelke I guess you’ll need to use some logic around, substring and remove functions of a String.
You can first Check if the Length of the String is greater than 4000, then use :
stringVar.SubString(0,4000-1) and stringVar.Remove(0,4000-1)
else :

I guess you could do something like this, If you didn’t understand Properly, I can make a workflow :sweat_smile:
Also how many text areas will be present ?

Thanks for your reply.

There will be only 1 text area and text length might be anything, but it should divide it into equal parts and each part will contain only 4000 chars.


@MaheshShelke You want to Store those Each 4000 characters , In that case We might need an array to Store it After Separation Like How i explained.

Were you able to Understnad the Logic I Suggested :sweat_smile:

I understood, but confused in ho to put it in array…i have not used arrays more :frowning:

@MaheshShelke Yeah, It Should be done using List of Strings, Check the workflow if this is what you needed :sweat_smile:
SplitStringBasedOnNumberOfCharacters.zip (2.2 KB)

The workflow splits for 10 Characters, You can change the value to 4000 as you need, Change the Value in Invoke Method Parameters as well

1 Like




Please find the below excel file with two SHEETS “New” and “Result” (with sample string) …

Sheet New contains input string and Sheet Result contains your output.

You can edit this code however you want.

For now I have created a variable to have limit as 40 characters. and input string has total for 101 charactors.

This code will divide string with respect to section of 40 characters each…

@MaheshShelke_Solution.xaml (14.2 KB)

Excel1.xlsx (8.3 KB)

Kindly mark this as SOLUTION and Close this post if you are satisfied with my solution.

Thanks and Regards,