I want to remove a part of string from one character, that is:
Source string:
manchester united (with nice players)
Target string:
I would at first split the original string into an array of String with a token " (" and the String at position 0 of the output array is what you would like to have.
String[] output = originalString.split(" ("); String result = output[0];