Fixes bug in stringBetween

This commit is contained in:
2018-02-01 13:46:51 +01:00
parent 3a1e61c754
commit 9d18abf1ed
2 changed files with 24 additions and 44 deletions

View File

@ -349,7 +349,10 @@ public class Server {
* @param end The substring after the wanted substring
* @return The wanted substring.
*/
private String stringBetween(String string, String start, String end) {
private static String stringBetween(String string, String start, String end) {
if (!string.contains(start)) {
return "";
}
int startPos = string.indexOf(start) + start.length();
return string.substring(startPos, string.indexOf(end, startPos));
}