code: public static String getPackageName(String className) {
          int i = className.lastIndexOf(".");
          String packageName = "";
          if (i > -1) {
              packageName = className.substring(0, i);
          }
          return packageName;
      }
docs: Returns the package prefix without the class name eg ('a.b.ClassName' becomes 'a.b').
  
  @param className The class name to get the package prefix for
  @return The package prefix of the class