Indexof with 2 parameters

Hello, this is my problem
I need for example: variable.Substring(variable.indexOf(“x”) || (or) variable.indexOf(“y”),variable.LastIndex(“z”))
THANKS !

1 Like

Hi @Marcin

Could you elaborate?

Example of your input data and expected output data would certainly be helpful :slight_smile:

@loginerror
Hi Maciej
I have another question.
I need condition in do while loop with two parameters.
First: my_variable <> true
Second: time limit or counter
Both condition with logic operator OR (||)
My counter doesn’t work.
In this moment I have: my_variable <> true OR my_counter < 2 ( I have assign my_counter = my_counter +1)

THANKS !

Hi @Marcin

Do you output the variable my_counter to the console to make sure it gets properly incremented?

If you mean that it does not work, do you mean that you never exit the loop or never loop over more than one iteration?

Hi @loginerror

Maciej
They are answers :
ANS 1:
Counter

ANS 2:
Never exit the loop
Counter3

I’d like after the second increment get out of the loop / or condition is met.
When I have only length (my_variable <> true) , operation is OK.
But I need counter or time limit :
Counter2

Thanks !

The do while loop will continue when the condition returns True as a whole. It will stop when the condition returns False as a whole.

As I understand, you use OR right now which means that if any of your variables is true, the loop will return True as a whole and thus continue.

Try using AND instead :slight_smile:

1 Like

Thanks Maciej !!