code: public static String getPrefix(String s) {
          int dot = s.lastIndexOf(".");
          if (dot == -1) {
              return s;
          } else {
              return s.substring(0, dot);
          }
      }
docs: blabla.ahah.ohoh --> blabla