How can I trim the leading or trailing characters from a string in java?
For example, the slash character \"/\" - I\'m not interested in spaces, and am looking to t
You can use Apache StringUtils.stripStart to trim leading characters, or StringUtils.stripEnd to trim trailing characters.
For example:
System.out.println(StringUtils.stripStart("//test/me", "/"));
will output:
test/me
Note that if for some reason you can't use the whole StringUtils library, you could just rip out the relevant parts, as detailed here: