--- title: "split text(size)" slug: "string-split-text" updated: 2026-08-17T08:17:55Z published: 2026-08-17T08:17:55Z canonical: "docs.lobstersoftware.com/string-split-text" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # split text(size) This function splits text **a** into substrings of length **b** and adds them to list **c**. The procedure is repeated for the remaining substring until it is empty. The last substring can therefore have a length smaller than **b**. The return value of the function is the number of substrings added to list **c**. Parameter **d** allows you to remove leading and trailing whitespaces. ## Parameters | Parameter | Description | | --- | --- | | a | Text. | | b | Substring length. | | c | Name of list for substrings. **NOTE:** If the list does not already exist, it is created automatically. | | d | (optional) *true* to remove leading and trailing whitespaces. Default: *false*. | ## Examples | Parameter a | Parameter b | Parameter c | Parameter d | Result | | --- | --- | --- | --- | --- | | This text is used for testing! | 4 | list_text_split | true | *8* (List *list_text_split* with values {*This*,*tex*,*t is*,*use*,*d fo*,*r te*,*stin*,*g!*}) | | This text is used for testing! | 4 | list_text_split | false | *8* (List *list_text_split* with values {*This*, *tex*,*t is*, *use*,*d fo*,*r te*,*stin*,*g!*}) |