StringContains

See javadoc - uk.gov.gchq.koryphe.impl.predicate.StringContains

Available since Koryphe version 1.0.0

Checks if a string contains some value

Examples

String contains value

Note - the StringContains predicate is case sensitive by default, hence only exact matches are found.

Java
JSON
Full JSON
Python
final StringContains function = new StringContains("test");
{
  "class" : "StringContains",
  "value" : "test",
  "ignoreCase" : false
}
{
  "class" : "uk.gov.gchq.koryphe.impl.predicate.StringContains",
  "value" : "test",
  "ignoreCase" : false
}
g.StringContains( 
  value="test", 
  ignore_case=False 
)

Input type:

java.lang.String

Example inputs:

Input TypeInputResult
java.lang.StringThis is a Testfalse
java.lang.StringTestfalse
java.lang.Stringtesttrue

String contains value ignore case

Here the optional flag is set to true - this disables case sensitivity.

Java
JSON
Full JSON
Python
final StringContains function = new StringContains("test", true);
{
  "class" : "StringContains",
  "value" : "test",
  "ignoreCase" : true
}
{
  "class" : "uk.gov.gchq.koryphe.impl.predicate.StringContains",
  "value" : "test",
  "ignoreCase" : true
}
g.StringContains( 
  value="test", 
  ignore_case=True 
)

Input type:

java.lang.String

Example inputs:

Input TypeInputResult
java.lang.StringThis is a Testtrue
java.lang.StringTesttrue
java.lang.Stringtesttrue

results matching ""

    No results matching ""