
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
check if the input string is in the list of strings
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?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks!is there any easy function to use like stringhandling.equals?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
_

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using the String.contains("value") function?eg:
context.input_cities.contains(row1.columnName)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
