Try this :
String[] data = "patient1234567 GMT+ howtoget".split("\\+")[0].split(" ");
System.out.println(data[data.length - 1]);
Output :
GMT
0
solved Java: Getting a substring before a certain character
Try this :
String[] data = "patient1234567 GMT+ howtoget".split("\\+")[0].split(" ");
System.out.println(data[data.length - 1]);
Output :
GMT
0
solved Java: Getting a substring before a certain character