Goto main content

chunk_split

Split a string into smaller chunks.

CHUNK_SPLIT

NAME

chunk_split - Splits a string into smaller chunks.

SYNOPSIS

chunk_split(string,chunklen,end)

PARAMETERS

string
The string that will be separated into pieces.
chunklen
The needed chunk lenght.
end
The line ending sequence.

RETURN

string
Returns the chunked string. If the user chose to split the word apple in chunk of 2 letters with the * ending sequence, one will get: ap=*pl=*e.

EXAMPLES

in:  res={{chunk_split("hello world",2,"=-")}}.
out: res=he=-ll=-o =-wo=-rl=-d.

in:  res={{chunk_split("hello world",2)}}.
out: res=he\r
ll\r
o \r
wo\r
rl\r
d").

SEE ALSO

{{ include("includes/strings.sn") }}

AUTHOR

Written by Pusnei Sergey and Caroline Laplante, <sergey@sednove.com>

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.