javaapache-stringutils

StringUtils Overload chop method


I want to overload the chop method of StringUtils to remove the last character if it is a backslash(\).

Is it possible to overload the function or I need to use an if condition?


Solution

  • Why not this instead?

    StringUtils.removeEnd(s,"\\")