StringContains

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

Available since Koryphe version 1.0.0

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( 
  ignore_case=False, 
  value="test" 
)

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( 
  ignore_case=True, 
  value="test" 
)

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 ""