src/main/java/org/jivesoftware/smack/util/StringUtils.java
public static String parseResource(String XMPPAddress) {
        if (XMPPAddress == null) {
            return null;
        }
        int slashIndex = XMPPAddress.indexOf("/");
        if (slashIndex + 1 > XMPPAddress.length() || slashIndex < 0) {
            return "";
        } else {
            return XMPPAddress.substring(slashIndex + 1);
        }
    }
public static String parseResource(String XMPPAddress) {
        if (XMPPAddress == null) {
            return null;
        }
        int slashIndex = XMPPAddress.indexOf("/");
        if (slashIndex + 1 > XMPPAddress.length() || slashIndex < 0) {
            return "";
        } else {
            return XMPPAddress.substring(slashIndex + 1);
        }
    }
Returns the resource portion of a XMPP address. For example, for the
address "matt@jivesoftware.com/Smack", "Smack" would be returned. If no
resource is present in the address, the empty string will be returned.

@param XMPPAddress
the XMPP address.
@return the resource portion of the XMPP address.