regex - Java Find Substring Inbetween Characters -
i stuck. use format read player's name in string, so:
"[player_yourname]"
i have tried few hours , can't figure out how read part after '_' , before ']' there name.
could have help? played around sub strings, splitting, regex , no luck. thanks! :)
btw: question different, if split _ don't know how stop @ second bracket, have other string lines past second bracket. thanks!
you can do:
string s = "[player_yourname]"; string name = s.substring(s.indexof("_") + 1, s.lastindexof("]"));
Comments
Post a Comment