Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
例如:
patient1234567 GMT+ howtoget
我想获取之前的信息+,在这种情况下,那将是GMT. 我正在使用的字符串有超过 1000 个字符,我已经尝试过 indexof 并且无法让它工作。
+
GMT
任何人都可以提供任何帮助吗?
试试这个 :
String[] data = "patient1234567 GMT+ howtoget".split("\\+")[0].split(" "); System.out.println(data[data.length - 1]);
输出 :