$middle(), $substring()

DESCRIPTION
    for a string, return a specified number of characters at the given index position

    or:

    for a string, return all characters to the end of the string starting at
    the given index position
SYNOPSIS
    $middle(s,i1,i2)

    or:

    $middle(s,i)
ARGUMENTS
     s - a quoted string, or string expression
    i1 - a positive integer, or integer expression
    i2 - a positive integer, or integer expression

    or:

     s - a quoted string, or string expression
     i - a positive integer, or integer expression
EXAMPLES
# pikt +C 'output $middle("earth",2,3)'
art
# pikt +C 'output $substring("string theory",8)'
theory
        rule    // strip any [ or ]
                if $left($proc, 1) eq "["
                        set $proc = $mid($proc, 2)
                        =chomp($proc, "]")
                fi
        rule    // set $gname, stripping off "+" or "-", if present
                set $gname = $substr($group,#if(#nis,2,1))
        rule    // find $user and $newuser
                set #i = #index($users, "-")
                set $user = $substr($users,1,#i-1)
                set $newuser = $substr($users,#i+1)
SEE ALSO
    $chop()
    $left()
    $right()
    $ltrim()
    $rtrim()
    $trim()

    String Functions
    Numerical Functions
 
Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software
Developer's Notes | Licensing | Authors | Pikt-Users | Pikt-Workers | Related Projects | Site Index | Privacy Policy | Contact Us
Page best viewed at 1024x768 or greater.   Page last updated 2019-01-12.   This site is PIKT® powered.
Copyright © 1998-2019 Robert Osterlund. All rights reserved.
Home FAQ News Intro Samples Tutorial Reference Software
PIKT Logo
PIKT Page Title
Learn about
Pikt script
objects, names &
data types