Replaces parts of the string.

import {StringBuilder} from "nativescript-stringformat";

// "Marcel Joachim Kloubert"
new StringBuilder("Marcel Peter Kloubert")
    .replace("Peter", "Joachim");

// "MARCEL Joachim KLOUBERT"
new StringBuilder("MARCEL PETER KLOUBERT")
    .replace(/(Peter)/i, "Joachim");

// "marcel joachim kloubert"
new StringBuilder("marcel JOACHIM kloubert")
    .replace(/(Joachim)/i,
             function(match) {
                 return match.toLowerCase();
             });