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 TypeInputResult TypeResult
java.lang.Stringteajava.lang.Stringtea
java.lang.StringTeajava.lang.StringTea
java.lang.StringTEAjava.lang.StringTEA
java.lang.Stringbrainteaserjava.lang.Stringbrainteaser
nullnull
java.lang.Stringcoffeejava.lang.Stringcoffee
java.lang.Long5ClassCastException: java.lang.Long cannot be cast to java.lang.String

results matching ""

    No results matching ""