[java] How to trim a string after a specific character in java