code: public static String getText (TextBoxBase box, String defaultAsBlank)
      {
          String s = box.getText().trim();
          return s.equals(defaultAsBlank) ? "" : s;
      }
docs: Retrieve the text from the TextBox, unless it is the specified default, in which case
  we return "".