comp.lang.ada
 help / color / mirror / Atom feed
From: Dale Stanbrough <dale@goanna.cs.rmit.edu.au>
Subject: Re: Parsing a line into strings
Date: 1998/07/09
Date: 1998-07-09T00:00:00+00:00	[thread overview]
Message-ID: <6o167q$d3t$1@goanna.cs.rmit.edu.au> (raw)
In-Reply-To: 35A3A199.D55C3153@oit.edu

"If you're using GNAT, the package GNAT.Spitbol has such a feature."

Spitbol is a rather large hammer to crack a rather small nut.
I have a package that will do what you want to do. It is at...

    http://www.cs.rmit.edu.au/~dale/software/index.html


From the package spec...

  function Select_Field (
      Item            : String;
      Field_No        : Integer;
      Field_Separator : Character) return String;

   --  Returns a string that represents the nth string in the field.
   --  The 'first of the return string is always set to one
   --  Fields are separated by the supplied character
   --  E.g.
   --
   --     Field ("cat:dog:mouse", 3, ':')
   --
   --  would result in the string
   --
   --     "mouse"
   --
   --  A -ve value indicates searching from the RHS.
   --
   --  E.g.
   --
   --     Field ("cat:dog:mouse", -1, ':')
   --
   --  would result in the string
   --     "mouse"


Dale




  parent reply	other threads:[~1998-07-09  0:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-07-08  0:00 Parsing a line into strings C N
1998-07-08  0:00 ` Samuel Tardieu
1998-07-08  0:00   ` C N
1998-07-09  0:00     ` Dmitriy Anisimkov
1998-07-08  0:00       ` Brian Rogoff
1998-07-08  0:00         ` nabbasi
1998-07-09  0:00           ` Robert Dewar
1998-07-09  0:00             ` Michael F Brenner
1998-07-14  0:00             ` Norman H. Cohen
1998-07-15  0:00               ` Robert I. Eachus
1998-07-18  0:00                 ` Robert Dewar
1998-07-08  0:00         ` Robert Dewar
1998-07-09  0:00           ` Brian Rogoff
1998-07-09  0:00 ` Darren Davenport
1998-07-10  0:00   ` Robert I. Eachus
1998-07-09  0:00 ` dennison
1998-07-09  0:00 ` Dale Stanbrough [this message]
1998-07-11  0:00 ` david.c.hoos.sr
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox