cdm/src/main/java/ucar/nc2/Variable.java
public String readScalarString() throws IOException {
    Array data = getScalarData();
    if (dataType == DataType.STRING)
      return (String) data.getObject(Index.scalarIndexImmutable);
    else if (dataType == DataType.CHAR) {
      ArrayChar dataC = (ArrayChar) data;
      return dataC.getString();
    } else
      throw new IllegalArgumentException("readScalarString not STRING or CHAR " + getFullName());
  }
public String readScalarString() throws IOException {
    Array data = getScalarData();
    if (dataType == DataType.STRING)
      return (String) data.getObject(Index.scalarIndexImmutable);
    else if (dataType == DataType.CHAR) {
      ArrayChar dataC = (ArrayChar) data;
      return dataC.getString();
    } else
      throw new IllegalArgumentException("readScalarString not STRING or CHAR " + getFullName());
  }
Get the value as a String for a scalar Variable.  May also be one-dimensional of length 1.
May also be one-dimensional of type CHAR, which wil be turned into a scalar String.

@throws IOException                   if theres an IO Error
@throws UnsupportedOperationException if not a scalar or one-dimensional.
@throws ClassCastException            if data type not DataType.STRING or DataType.CHAR.