Cleanup splitting string into a pair
Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
This commit is contained in:
15
libraries/launcher/org/prismlauncher/utils/StringUtils.java
Normal file
15
libraries/launcher/org/prismlauncher/utils/StringUtils.java
Normal 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) };
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user