Thanks for your reply. Works perfectly fine
In case someone looking for another solution, I solved it with Java Snippet (simple) node:
String str = $yourString$;
if (str.endsWith(β0β)){
str = str.substring(0, str.length() - 1);
return str;
} else {
return str;
}