0 votes
1 view
in RPA by (12.8k points)
edited by

I trying to find the syntax where I can use Not keyword with String.Contains condition in UIPath.

Example: I have the following variable.

strValue = “This is Test”

I want to check whether the 'Test' word does not exist in the variable then it should show me some message.

I have tried the below approach but it did not work.

Not strValue.Contains(“Test”)

1 Answer

0 votes
by (29.8k points)

The command indexOf() returns -1 if the value to the search is not present in the string. I have mentioned a sample code below:

strValue = “This is Test”
var i = strValue.indexOf("Test");
if(i>0){
  console.log('Test is present in strValue');
}

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...