public static @DottedClassName String extractPackageName(@DottedClassName String className){
  int i=className.lastIndexOf('.');
  if (i < 0) {
    return "";
  }
  return className.substring(0,i);
}

public static @ DottedClassName String extractPackageName ( @ DottedClassName String className ) { int i = className . lastIndexOf ( '.' ) ; if ( i < 0 ) { return "" ; } return className . substring ( 0 , i ) ; }
extract the package name from a dotted class name . package names are always in dotted format .
