$chop()

DESCRIPTION
    returns a string with a specified number of characters chopped off the end

    or:

    returns string a minus its last character
SYNOPSIS
    $chop(s,i)

    or:

    $chop(s)
ARGUMENTS
    s - a quoted string, or string expression
    i - an integer greater than or equal to zero

    or:

    s - a quoted string, or string expression
EXAMPLES
# pikt +C 'output $chop("Off with his head!",5)'
Off with his
# pikt +C 'output $chop("Chop-O-Matic")'
Chop-O-Mati
chop(S)         // like Perl's chop, chop the last char off of string S
                set (S) = $chop((S))

chomp(S, C)     // sort of like Perl's chomp, chop the last char off of
                // string S if it's a (C)
                if $right((S),1) eq (C)
                        set (S) = $chop((S))
                fi
        rule    // dispose of trailing comma, and set value
                set #la1 = #value($chop($a1,1))
SEE ALSO
    $chop()
    $middle(), $substring()
    $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
View sample
output
macros