java string replace after character code example Example: replace everything before a character in java result = result.split("\n")[0];