StringReplace
See javadoc - uk.gov.gchq.koryphe.impl.function.StringReplace
Available since Koryphe version 1.9.0
Replace all portions of a string which match a regular expression.
Examples
Replace strings
Java
JSON
Full JSON
Python
final StringReplace function = new StringReplace("[tea", "cake");
{
"class" : "StringReplace",
"replacement" : "cake",
"searchString" : "[tea"
}
{
"class" : "uk.gov.gchq.koryphe.impl.function.StringReplace",
"replacement" : "cake",
"searchString" : "[tea"
}
g.StringReplace(
search_string="[tea",
replacement="cake"
)
Input type:
java.lang.String
Example inputs:
Input Type | Input | Result Type | Result |
---|---|---|---|
java.lang.String | tea | java.lang.String | tea |
java.lang.String | Tea | java.lang.String | Tea |
java.lang.String | TEA | java.lang.String | TEA |
java.lang.String | brainteaser | java.lang.String | brainteaser |
null | null | ||
java.lang.String | coffee | java.lang.String | coffee |
java.lang.Long | 5 | ClassCastException: java.lang.Long cannot be cast to java.lang.String |