code: public static String trimTo(final String aString, final String aDefault) {
          if (aString == null) {
              return aDefault;
          }
  
          final String trimmed = aString.trim();
          return trimmed.length() == 0 ? aDefault : trimmed;
      }
docs: Trims a string; if there is nothing left after the trimming, returns whatever the default value passed in is.
  
  @param aString The string to be trimmed
  @param aDefault A default string to return if a null string is passed in
  @return The trimmed string or the default value if string is empty