DEVELOPMENT EDITION · 769442725406
Library Reference
On this page

Ada.Strings

Space and the declared string-operation enumeration types.

Read the family guide for representation, selection and resource rules. The complete declaration page retains exact signatures/contracts; the source specification is the implementation baseline.

Availability and ownership

Declares Space and the enumerations the string packages take.

A client proof uses these contracts without proving the body again (see library assurance). Global => null excludes package-global effects, not changes made through an in out argument.

Import and instantiate

with Ada.Strings;
import Ada.Strings;

A Vibe module imports this unit's names with from Ada.Strings import Name; see library use across syntaxes. In Varc, keep each name's declared spelling and write & on arguments the call changes.

Contract and lifecycle reading

A Pre condition is the caller's obligation; a Post is what a normal return guarantees. What a postcondition does not state, a client cannot assume. Ghost functions are for contracts and ghost code. The family guide describes copying, lifetime, order and cost.

API 001

Space (declaration) — The ordinary space Character, Latin-1 position 32; distinct from no-break space and general whitespace.

Declared interface:

Space : constant Character := ' ';

API 002

Wide_Space (declaration) — The Wide_Character space.

Declared interface:

Wide_Space : constant Wide_Character := ' ';

API 003

Wide_Wide_Space (declaration) — The Wide_Wide_Character space.

Declared interface:

Wide_Wide_Space : constant Wide_Wide_Character := ' ';

API 004

Length_Error, Pattern_Error, Index_Error, Translation_Error (declaration) — Ada's exceptions of the string packages: Verada's operations rule out Index_Error and Pattern_Error by preconditions; Length_Error is raised by Text_IO.Bounded_IO's Get_Line of a line longer than the bound.

Declared interface:

Length_Error, Pattern_Error, Index_Error, Translation_Error : exception;

API 005

Alignment (declaration) — Left/Right/Center alignment choices; only operations actually declared in the supplied subset use them.

Declared interface:

type Alignment is (Left, Right, Center);

API 006

Truncation (declaration) — Left/Right/Error truncation policy names; the bounded-string subset does not thereby acquire a Drop parameter.

Declared interface:

type Truncation is (Left, Right, Error);

API 007

Membership (declaration) — Inside/Outside membership choices for APIs that explicitly accept this enum.

Declared interface:

type Membership is (Inside, Outside);

API 008

Direction (declaration) — Forward/Backward search direction.

Declared interface:

type Direction is (Forward, Backward);

API 009

Trim_End (declaration) — Left/Right/Both ordinary-space trimming choices.

Declared interface:

type Trim_End is (Left, Right, Both);