Java tutorial
//package com.java2s; public class Main { /** * This method will extract a resType from an URI. * * @param idUri The URI containing the Id * @return A resType (extracted from the URI or left unchanged) */ public static String extractResTypeFromURI(String idUri) { String s = idUri.replace("http://musicbrainz.org/", ""); String[] f = s.split("/"); if (f == null || f.length < 2) return idUri; else return f[0]; } }