Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Test {
- public static void main(String[] args) {
- assertEqual("TestDit", parse("getTestDit"));
- assertEqual("TestDit", parse("TestDit"));
- assertEqual("", parse("get"));
- System.out.println("done");
- }
- private static void assertEqual(String expected, String actual) {
- if (!expected.equals(actual)) {
- throw new AssertionError("Expected [" + expected + "] got [" + actual + "]");
- }
- }
- public static String parse(String input) {
- return input.replaceAll("^get", "");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement