trimPattern method
Implementation
String trimPattern(String pattern) {
String tempString = this;
if (startsWith(pattern)) {
tempString = substring(pattern.length, tempString.length);
}
if (endsWith(pattern)) {
tempString = substring(0, tempString.length - pattern.length);
}
return tempString;
}