*/
package jalview.util;
-import java.util.Locale;
-
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
+import java.util.Locale;
+import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class StringUtils
}
return min < text.length() + 1 ? min : -1;
}
+
+ public static int indexOfFirstWhitespace(String text)
+ {
+ int index = -1;
+ Pattern pat = Pattern.compile("\\s");
+ Matcher m = pat.matcher(text);
+ if (m.find())
+ {
+ index = m.start();
+ }
+ return index;
+ }
}