Text Functions

Hello

I need to split a big text(200 characters let's say) so that at each 4th character I want to insert a new line.
The purpose is to display this big text in a paging grid.
Any ideas ?
Thanks in advance !

Ovidiu


OriginalPostID-251160

  Discussion posts and replies are publicly visible

Parents
  • load(
    local!len: len(
    ri!word
    ),
    local!index: enumerate(
    local!len
    ) + 1,
    local!indices: a!forEach(
    items: local!index,
    expression: {
    if(
    fv!item = 1,
    0 + 1,
    if(
    len(
    tostring(
    fv!item / ri!count
    )
    ) = 1,
    fv!index + 1,
    {}
    )
    )
    }
    ),
    local!result: joinarray(
    a!forEach(
    items: local!indices,
    expression: mid(
    ri!word,
    fv!item,
    ri!count
    )
    ),
    char(
    10
    )
    ),
    local!result
    )


    ri!word = Your long text
    ri!count = How many character you want to split them into
Reply
  • load(
    local!len: len(
    ri!word
    ),
    local!index: enumerate(
    local!len
    ) + 1,
    local!indices: a!forEach(
    items: local!index,
    expression: {
    if(
    fv!item = 1,
    0 + 1,
    if(
    len(
    tostring(
    fv!item / ri!count
    )
    ) = 1,
    fv!index + 1,
    {}
    )
    )
    }
    ),
    local!result: joinarray(
    a!forEach(
    items: local!indices,
    expression: mid(
    ri!word,
    fv!item,
    ri!count
    )
    ),
    char(
    10
    )
    ),
    local!result
    )


    ri!word = Your long text
    ri!count = How many character you want to split them into
Children
No Data