How to get the Substring before a Character in Java

How to get the Substring before a Character in Java