$right()

DESCRIPTION
    returns the specified right-most characters in a string
SYNOPSIS
    $right(s,i)
ARGUMENTS
    s - a quoted string, or string expression
    i - a positive integer, or integer expression
EXAMPLES
# pikt +C 'output $right("a wrong",5)'
wrong
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    // trim leading $ and set the dollar amount
		set #dollars = #val($right($d,#length($d)-1))
        rule    // dispose of possible ending "*" in ident
                if $right($ident,1) eq "\*"
                        set $ident2 = $chop($ident)
                else
                        set $ident2 = $ident
                endif
set_datestamp   // set $datestamp = "991215", for example
                set $datestamp = $right($text(#year()),2) .
                    $if(#month()<10, "0", "") . $text(#month()) .
                    $if(#day()<10, "0", "") . $text(#day())

SEE ALSO
    $left()
    $chop()
    $middle(), $substring()
    $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
Download the
latest official
PIKT release