К примеру у меня есть строка
CurrentlyPlaying(context=Context(type=PLAYLIST, href=https://api.spotify.com/v1/playlists/29GSd1GDp2VSxhUcz0pyzA, externalUrls=ExternalUrl(externalUrls={spotify=https://open.spotify.com/playlist/29GSd1GDp2VSxhUcz0pyzA}), uri=spotify:playlist:29GSd1GDp2VSxhUcz0pyzA), timestamp=1648062889952, progress_ms=170258, is_playing=true, item=Track(name=Rainbow In The Dark, artists=[ArtistSimplified(name=Dio)
Как из неё вырезать слово после artists=[ArtistSimplified(name=
Чтобы получилось Dio
?
Я пробовал что-то такое
Pattern p = Pattern.compile("artists=[ArtistSimplified(name=");
Matcher m = p.matcher(currentlyPlaying.toString());
while (m.find()){
i++;
}
// здесь substring по индексу i
но не получается и выдает 4 почему-то..