package org.apache.logging.log4j.util;

public final class Strings {
   public static final String EMPTY = "";

   private Strings() {
   }

   public static boolean isEmpty(CharSequence cs) {
      return cs == null || cs.length() == 0;
   }

   public static boolean isNotEmpty(CharSequence cs) {
      return !isEmpty(cs);
   }

   public static String trimToNull(String str) {
      String ts = str == null ? null : str.trim();
      return isEmpty(ts) ? null : ts;
   }
}
