Re: capital letter conversion

From: Wei Huang <huangwei_at_nyahnyahspammersnyahnyah>
Date: Fri, 20 Mar 2009 15:46:12 -0600

Kai,

Currently we do not have this function in the NCL 5.1.
But we have already worked on the string functions,
which will have these functionalities in the next release.
If you generated your executable yourself, we can mail the
source code for string function for your to test.

Below are some the function can do the work for you:
1. convert all to lower case:

ncl 6> str = "AaA"
ncl 7> low_str = str_lower(str)
ncl 8> print("lower str: <" + low_str + ">")
(0) lower str: <aaa>

2. convert all to upper case:

ncl 9> up_str = str_upper(str)
ncl 10> print("upper str: <" + up_str + ">")
(0) upper str: <AAA>

3. switch upper to lower, and lower to upper

ncl 11> sw_str = str_switch(str)
ncl 12> print("switch str: <" + sw_str + ">")
(0) switch str: <aAa>

4. capitalize a string:

ncl 13> strs = (/"NCL has many features common to modern programming
languages,", \
ncl 13> "including types, variables, operators,
expressions,", \
ncl 13> "conditional statements, loops, and functions and
procedures."/)
ncl 14> cptl = str_capital(strs)
ncl 16> print("capitalized string: <" + cptl + ">")
(0) capitalized string: <NCL Has Many Features Common To Modern
Programming Languages,>
(1) capitalized string: <Including Types, Variables, Operators,
Expressions,>
(2) capitalized string: <Conditional Statements, Loops, And
Functions And Procedures.>

There are many more string function. Listed here are the ones related
to your question.

We are working on more extensive tests, and documentation.
These functions will be in the next release.

Regards,

Wei Huang
huangwei_at_ucar.edu
VETS/CISL
National Center for Atmospheric Research
P.O. Box 3000 (1850 Table Mesa Dr.)
Boulder, CO 80307-3000 USA
(303) 497-8924

On Mar 19, 2009, at 5:57 AM, Kai Zhang wrote:

> Dear all,
>
> Is there a NCL- function which can do "AaA->aaa", "aaA->AAA", and
> "AAa->aaA"?
>
> thanks and best regards, Kai
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Mar 20 2009 - 15:46:12 MDT

This archive was generated by hypermail 2.2.0 : Wed Mar 25 2009 - 15:36:00 MDT