Java tutorial
//package com.java2s; public class Main { private static String removeLastSegment(final String fqcn) { return fqcn.substring(0, fqcn.lastIndexOf(".")); } }