Ada Programming/Libraries/Ada.Strings.Unbounded

is a unit of the Predefined Language Environment since Ada 95.

This package defines the operations for unbounded string handling.

Usage
is used in several places. Here some relevant extracts. As always you can follow the download links to see the full examples.

Conversion between unbounded and bounded strings:

;    SU    Ada.Strings.Unbounded; X : SU.Unbounded_String := SU.To_Unbounded_String (CL.Argument (1)); T_IO.Put_Line (SU.To_String (X)); X := SU.To_Unbounded_String (CL.Argument (2)); T_IO.Put_Line (SU.To_String (X));

Another example:

;   Str  Ada.Strings.Unbounded; Get_Line Str.Unbounded_String; Str.Unbounded_String; Operation : Str.Unbounded_String; Get_Line Str.Unbounded_String BufferSize : := 2000; Retval    : Str.Unbounded_String := Str.Null_Unbounded_String; Item      : String (1 .. BufferSize); Last      : Natural; Get_Whole_Line : T_IO.Get_Line (Item => Item, Last => Last); Str.Append (Source => Retval, New_Item => Item (1 .. Last)); Get_Whole_Line Last < Item'; Get_Whole_Line; Retval; Get_Line;

Specification
Preelaborate Unbounded Unbounded_String Preelaborable_Initialization Unbounded_String Null_Unbounded_String  Unbounded_String Length Source  Unbounded_String  Natural String_Access   String Free X   String_Access To_Unbounded_String Source  String Unbounded_String To_Unbounded_String Length  Natural Unbounded_String To_String Source  Unbounded_String  String Set_Unbounded_String Target     Unbounded_String Source      String Append Source     Unbounded_String New_Item  Unbounded_String Append Source     Unbounded_String New_Item  String Append Source     Unbounded_String New_Item  Character "" Left Right  Unbounded_String Unbounded_String "" Left  Unbounded_String Right   String Unbounded_String "" Left  String Right   Unbounded_String Unbounded_String "" Left  Unbounded_String Right   Character Unbounded_String "" Left  Character Right   Unbounded_String Unbounded_String Element Source  Unbounded_String Index   Positive Character Replace_Element Source   Unbounded_String Index   Positive By      Character Slice Source  Unbounded_String Low     Positive High    Natural String Unbounded_Slice Source  Unbounded_String Low     Positive High    Natural Unbounded_String Unbounded_Slice Source      Unbounded_String Target     Unbounded_String Low         Positive High        Natural "" Left Right   Unbounded_String  Boolean "" Left   Unbounded_String Right   String Boolean "" Left   String Right   Unbounded_String Boolean "" Left Right   Unbounded_String  Boolean "" Left   Unbounded_String Right   String Boolean "" Left   String Right   Unbounded_String Boolean "" Left Right  Unbounded_String  Boolean "" Left   Unbounded_String Right   String Boolean "" Left   String Right   Unbounded_String Boolean "" Left Right   Unbounded_String  Boolean "" Left   Unbounded_String Right   String Boolean "" Left   String Right   Unbounded_String Boolean "" Left Right  Unbounded_String  Boolean "" Left   Unbounded_String Right   String Boolean "" Left   String Right   Unbounded_String Boolean Index Source   Unbounded_String Pattern  String From     Positive Going    Direction  Forward Mapping  MapsCharacter_Mapping  MapsIdentity Natural Index Source   Unbounded_String Pattern  String From     Positive Going    Direction  Forward Mapping  MapsCharacter_Mapping_Function Natural Index Source    Unbounded_String Pattern   String Going     Direction  Forward Mapping   MapsCharacter_Mapping MapsIdentity Natural Index Source    Unbounded_String Pattern   String Going     Direction  Forward Mapping   MapsCharacter_Mapping_Function Natural Index Source  Unbounded_String Set     MapsCharacter_Set From    Positive Test    Membership  Inside Going   Direction  Forward Natural Index Source  Unbounded_String Set     MapsCharacter_Set Test    Membership  Inside Going   Direction   Forward  Natural Index_Non_Blank Source  Unbounded_String From    Positive Going   Direction  Forward Natural Index_Non_Blank Source  Unbounded_String Going   Direction  Forward Natural Count Source    Unbounded_String Pattern   String Mapping   MapsCharacter_Mapping MapsIdentity Natural Count Source    Unbounded_String Pattern   String Mapping   MapsCharacter_Mapping_Function Natural Count Source    Unbounded_String Set       MapsCharacter_Set Natural Find_Token Source  Unbounded_String Set     MapsCharacter_Set Test    Membership First   Positive Last    Natural Translate Source   Unbounded_String Mapping  MapsCharacter_Mapping Unbounded_String Translate Source    Unbounded_String Mapping  MapsCharacter_Mapping Translate Source   Unbounded_String Mapping  MapsCharacter_Mapping_Function Unbounded_String Translate Source    Unbounded_String Mapping  MapsCharacter_Mapping_Function Replace_Slice Source    Unbounded_String Low       Positive High      Natural By        String Unbounded_String Replace_Slice Source     Unbounded_String Low       Positive High      Natural By        String Insert Source    Unbounded_String Before    Positive New_Item  String Unbounded_String Insert Source     Unbounded_String Before    Positive New_Item  String Overwrite Source     Unbounded_String Position   Positive New_Item   String Unbounded_String Overwrite Source      Unbounded_String Position   Positive New_Item   String Delete Source   Unbounded_String From     Positive Through  Natural Unbounded_String Delete Source    Unbounded_String From     Positive Through  Natural Trim Source  Unbounded_String Side    Trim_End Unbounded_String Trim Source   Unbounded_String Side    Trim_End Trim Source  Unbounded_String Left    MapsCharacter_Set Right   MapsCharacter_Set Unbounded_String Trim Source   Unbounded_String Left    MapsCharacter_Set Right   MapsCharacter_Set Head Source  Unbounded_String Count   Natural Pad     Character  Space Unbounded_String Head Source   Unbounded_String Count   Natural Pad     Character  Space Tail Source  Unbounded_String Count   Natural Pad     Character  Space Unbounded_String Tail Source   Unbounded_String Count   Natural Pad     Character  Space "" Left   Natural Right  Character Unbounded_String "" Left   Natural Right  String Unbounded_String "" Left   Natural Right  Unbounded_String Unbounded_String Import Ada Unbounded_String Import Ada Null_Unbounded_String AdaStringsUnbounded

Wikibook

 * Ada Programming
 * Ada Programming/Libraries
 * Ada Programming/Strings