Substring parameterized

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

Substring parameterized

Post by Fabio Pagano »

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: 6812
Joined: Tue Mar 20, 2018 5:34 am

Re: Substring parameterized

Post by Lech Kulikowski »

Hello,

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

Thank you.
User avatar
Fabio Pagano
Posts: 355
Joined: Mon Apr 16, 2007 12:38 pm
Location: Bari (Italy)

Re: Substring parameterized

Post by Fabio Pagano »

Great! Thank You
Andrew
Posts: 4107
Joined: Fri Jun 09, 2006 3:58 am

Re: Substring parameterized

Post by Andrew »

You are welcome, Fabio!
Post Reply