Cleanup splitting string into a pair

Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
This commit is contained in:
solonovamax
2022-10-31 15:56:53 -04:00
committed by TheKodeToad
parent 609b30110b
commit ac5b74301e
3 changed files with 63 additions and 55 deletions

View File

@ -0,0 +1,15 @@
package org.prismlauncher.utils;
public final class StringUtils {
private StringUtils() {
}
public static String[] splitStringPair(char splitChar, String input) {
int splitPoint = input.indexOf(splitChar);
if (splitPoint == -1)
return null;
return new String[]{ input.substring(0, splitPoint), input.substring(splitPoint + 1) };
}
}