Re: Character

From: Dennis Shea (shea AT XXXXXX)
Date: Tue Jul 29 2003 - 12:23:30 MDT

  • Next message: Zhuming Ying: "How to change a character"

    Hello.

    Along these lines, I'd just like to mention that in the
    NCL version "a030", there is a function in contributed.ncl
    that allows users the extract a substring from a variable
    of type string.

    function getSubString (s[*]:string, iStrt:integer, iLast:integer)
    ;*************************************************************************
    ; extract a sub-string from one or more strings
    ; a = "0850-0899"
    ; a1= getSubString(a, 0, 3) ; ==> a1 = "0850"
    ; a2= getSubString(a, 5, 8) ; ==> a2 = "0899"
    ;
    ; A = (/ "vorticity", "flux", "divergence" /)
    ; As= getSubString(A, 0, 4) ; ==> As = (/"vort","flux","dive"/)
    ;*************************************************************************

    >>
    >Hi, Could you like to tell me how to write a array of character?
    >
    >timee = new(4,character,"0")
    >timee(0) = "5"
    >timee(1) = "-"
    >timee(2) = ":"
    >timee(3) = "a"
    >
    >or timee = (/"5","-",":","a"/)
    >
    >and how could i change from string "5-:a" to character above?
    >
    >Thanks
    >
    >zhuming

    _______________________________________________
    ncl-talk mailing list
    ncl-talk AT ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk



    This archive was generated by hypermail 2b29 : Tue Jul 29 2003 - 13:17:07 MDT