cdm/src/main/java/ucar/ma2/ArrayChar.java
public String getString() {
    int rank = getRank();
    if (rank == 0) {
      return new String(storage);
    }

    if (rank != 1)
      throw new IllegalArgumentException("ArayChar.getString rank must be 1");
    int strLen = indexCalc.getShape(0);

    int count = 0;
    for (int k = 0; k < strLen; k++) {
      if (0 == storage[k])
        break;
      count++;
    }
    return new String(storage, 0, count);
  }
public String getString() {
    int rank = getRank();
    if (rank == 0) {
      return new String(storage);
    }

    if (rank != 1)
      throw new IllegalArgumentException("ArayChar.getString rank must be 1");
    int strLen = indexCalc.getShape(0);

    int count = 0;
    for (int k = 0; k < strLen; k++) {
      if (0 == storage[k])
        break;
      count++;
    }
    return new String(storage, 0, count);
  }
public String getString ( ) { int rank = getRank ( ) ; if ( rank == 0 ) { return new String ( storage ) ; } if ( rank != 1 ) throw new IllegalArgumentException ( "ArayChar.getString rank must be 1" ) ; int strLen = indexCalc . getShape ( 0 ) ; int count = 0 ; for ( int k = 0 ; k < strLen ; k ++ ) { if ( 0 == storage [ k ] ) break ; count ++ ; } return new String ( storage , 0 , count ) ; }
Create a String out of this rank one ArrayChar object.
If there is a null (0) value in the ArrayChar array, the String will end there.
The null is not returned as part of the String.

@return String value of CharArray
@throws IllegalArgumentException if rank != 1
Create a String out of this rank one ArrayChar object . If there is a null ( 0 ) value in the ArrayChar array the String will end there . The null is not returned as part of the String .