Tell me how to pull Id from the following link:

https://vimeo.com/api/v2/video/183364240.json 

Made by analogy with youtube:

 else if (input.contains("vimeo")) { vimeoUrl = "https://www.vimeo.com/"; String vimeoId = uri.getQueryParameter("v"); if (TextUtils.isEmpty(vimeoId)) { String[] str = input.split("/"); vimeoId = str[str.length - 1]; vimeoUrl = "https://vimeo.com/api/v2/video" + uri.getPath(); Log.d("vimeoUrl", vimeoUrl + " " + controlList.get(23).getImageUploads().size()); return vimeoUrl; 

Without a clue how to declare vimeoId, since the v parameter shown above does not contain v.

    1 answer 1

    For example, drag a line from the last slash to the last point.

     String url = "https://vimeo.com/api/v2/video/183364240.json"; String id = url.substring(url.lastIndexOf("/"), url.lastIndexOf("."); 
    • Thanks for the reaction, but it emphasizes subString in red, saying I can not implement this method. - Morozov
    • @VadimMorozov and so? url.toString (). subString (url.lastIndexOf ("/"), url.lastIndexOf ("."); - tCode
    • @tCode unfortunately also - Morozov
    • @VadimMorozov, try with a fry letter - Yuriy Spb