Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a context parameter context.input_cities with values 'chicago','new york'
How do i check if the input string is in conext.input_cities?
Hi, Maybe you can use tFixedFlowInput or tRowGenerator to read your input as a string then you can use tNormalize component to transform your coma separated value input into a flow and then you can do a lookup with this flow.
Send me love and kudos
thanks!is there any easy function to use like stringhandling.equals?
yes, but you can but you have to set this fonction for each value of your list, with full component solution I provide(these components are really easy to understand) it will be maintenable and don't need to be change if you're doing change in the list
i was asking if there was a function that could take take context.input_cities and input string as two arguments and perform the search
_
Using the String.contains("value") function?eg:
context.input_cities.contains(row1.columnName)
The contains way is a solution, but it is prone to false positives: it will match a sub-string like , or space or new etc...
you can make a custom routine with split string method :
String[] splitString = ((your list).split(","));
for (String string : splitString) {
if (string.equals(your input)) {return true;}
}
return false;
and for better performance you can separate the split from the search, to split only once the String.