Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { public static String getJIDWithoutResource(String jid) { if (jid != null && jid.length() > 0 && jid.lastIndexOf("/") > 1) return jid.substring(0, jid.lastIndexOf("/")); return jid; } }