Last time I was working on migration of some code from Python into Java and I was trying to find a corresponding code in Java for a function called
rstrip in Python. So, below you can see a code written in Python and solution written in Java produced of course using Guava.
CharMatcher trailingZeroMatcher = CharMatcher.is('0');
String trimmedInput = trailingZeroMatcher.trimTrailingFrom(input);
No comments:
Post a Comment