Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Fortran 90 Programmer's Reference: HP Series 700/800 Computers > Chapter 3 Data types and data objects

Character substrings

» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

A character -substring is a contiguous portion of a scalar character entity, referred to as the parent-string. The substring is defined by giving the character positions of its start and end. The format is:

parent-string ( [starting-position] : [ending-position])

starting-position

is a scalar expression. If starting-position is omitted, a value of 1 is assumed. The starting-position must be greater than or equal to 1 unless the substring has zero length.

ending-position

is a scalar integer expression. If ending-position is omitted the value of the length of the character string is assumed.

The length of the substring is:

MAX (ending-position - starting-position + 1, 0)

Following are examples of character substrings:

'ABCDEFGH' (3:5)

is a character substring of length 3 equal to 'CDE'.

'ABC' (-1 : 2)

is invalid.

'ABC'(2: -1)

has a zero length.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1996 Hewlett-Packard Development Company, L.P.