Substring parameterized

Stimulsoft Ultimate discussion
Post Reply
User avatar
Fabio Pagano
Posts: 354
Joined: Mon Apr 16, 2007 12:38 pm
Location: Bari (Italy)

Substring parameterized

Post by Fabio Pagano » Fri May 22, 2020 4:16 pm

Hi,
I need to use a part of text but i haven't always the same number of characters.

e.s
first step: to wake up
second step: to wash hands
third step: to get dressed

I need to use the part of the sentence before of ":"

like this
first step
second step
third step

I need something like "substring(text,1,index of ":")"

Could you help me?
thanks
Lech Kulikowski
Posts: 2455
Joined: Tue Mar 20, 2018 5:34 am

Re: Substring parameterized

Post by Lech Kulikowski » Mon May 25, 2020 8:00 am

Hello,

You can use the following expression:
{(Variable.IndexOf(":") != -1 ? Substring(Variable, 1, Variable.IndexOf(":") - 1) : "")}

Thank you.
Post Reply