login

rgnwrd.gsf

Top / GrADS / script / rgnwrd.gsf

Japanese / English

Name

rgnwrd() - Get strings separated by a string.

Synopsis

ret = rgnwrd( str, n_start, n_end [, sep] )

Options and Return values

str
Input strings.
n_start
Start number.
n_end
End_number.
sep
Separator string. One space by default.
ret
Strings between n_start-th and n_end-th.

Examples

(1) Cut a part of string.

  • test.gs
    rc = gsfallow( 'on' )
    str = 'This is a pen.'
    say rgnwrd( str, 2, 3, ' ' )
    say rgnwrd( str, 2, 3, 'is' )
    
  • console
    ga-> test
    is a
     is a pen.
    

Script source code