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 Type | Input | Result |
---|---|---|
java.lang.String | This is a Test | false |
java.lang.String | Test | false |
java.lang.String | test | true |
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 Type | Input | Result |
---|---|---|
java.lang.String | This is a Test | true |
java.lang.String | Test | true |
java.lang.String | test | true |