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