IsEmpty v0.1.0

Source
Reports whether the string holds no bytes.

Package: Text

Signature

func IsEmpty(self) -> bool;

Returns

true when the string holds no bytes, which is the case for New, for anything Free has left behind, and for a transformation that had nothing to give back.

Example

import Text::String;

func Main() -> int {
    String::New().IsEmpty(); // true

    var text = String::From("Rux");
    text.IsEmpty();          // false

    text.Free();
    text.IsEmpty();          // true -- Free leaves an empty string behind
    return 0;
}

See also

  • String — the string type
  • Length — the byte count this tests against zero
  • New — the empty string