replaceSuffix function
Implementation
String replaceSuffix(
String text,
String oldSuffix,
String newSuffix
)
{
if ( text.endsWith( oldSuffix ) )
{
return text.substring( 0, text.length - oldSuffix.length ) + newSuffix;
}
else
{
return text;
}
}