Код: Выделить всё
String myStr = "[3:0]";
if (myStr.trim().matches("\\[(\\d+)\\]")) {
// Do something.
// If it enter the here, here I want to store 3 and 0 in different variables or an array
}
Подробнее здесь: https://stackoverflow.com/questions/328 ... ring-in-it