Compare strings with quotes in them

zenrast

Client
Регистрация
20.03.2013
Сообщения
57
Благодарностей
1
Баллы
8
Hi,

i have a logical IF.
"{-Variable.keyword1-}"=="{-Variable.keyword2-}"
this returns TRUE if the keywords are the same.

But if the keywords are keywords with a quote like "apple" then the IF
returns FALSE.
The "Executed" in "Action properties" shows
""apple"" == ""apple""
and it returns FALSE.

How should i fix this problem? Is there a way to "trim" the keywords inside IF?
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 452
Благодарностей
5 910
Баллы
113
Hi,

i have a logical IF.
"{-Variable.keyword1-}"=="{-Variable.keyword2-}"
this returns TRUE if the keywords are the same.

But if the keywords are keywords with a quote like "apple" then the IF
returns FALSE.
The "Executed" in "Action properties" shows
""apple"" == ""apple""
and it returns FALSE.

How should i fix this problem? Is there a way to "trim" the keywords inside IF?
Are you sure that one of the keywords does not contain space or some hodden synbol?
Trim operation is available in Text processing action block
 

zenrast

Client
Регистрация
20.03.2013
Сообщения
57
Благодарностей
1
Баллы
8
Yes, im sure the kewyords does not contain the some extra symbol.
Try to put ""apple""==""apple"" in IF block and run it.
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 452
Благодарностей
5 910
Баллы
113

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 452
Благодарностей
5 910
Баллы
113
IF works this way:
 

Вложения

zenrast

Client
Регистрация
20.03.2013
Сообщения
57
Благодарностей
1
Баллы
8
I solved the problem by using the Text processing trim. Thanks for suggestion.
The Text_comparing.xmlz works for ", but then the problem returns if i have keywords with signle '.


I dont use quarter quotes but if i have a
var a = "\"apple\"";
..combined with IF "a" == "a" ....the end result is quarter quotes.
 
Последнее редактирование:

LightWood

Moderator
Регистрация
04.11.2010
Сообщения
2 382
Благодарностей
916
Баллы
113

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)