Ziqiang,
Can you provide a case where str_match doesn't behave as you expect?
str_match is case sensitive. This means that any one of the following statements will return a missing value:
i = str_match("ABC","a")
i = str_match("ABC","bc")
i = str_match("ABC","abc")
This will return a missing value too, because the characters aren't in the right order:
i = str_match("ABC","AC")
These statements will return non-missing values:
i = str_match("ABC","A")
i = str_match("ABC","AB")
i = str_match("ABC","BC")
There's a str_match_ic function which is not case sensitive. This function was added in NCL V6.0.0.
--Mary
On Nov 12, 2011, at 11:29 PM, JiangZiqiang wrote:
> Hello,
>
> When I use "str_match" function, it should return matched string.
> However, a matched string has existed, sometimes a missing value has been return still.
> I don't understand this, and I felt puzzled.
>
> function str_match ( string_val [*] : string, expression [1] : string )
> return_val [*] : string
>
> Ziqiang
>
> _______________________________________________
> 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 Mon Nov 14 08:44:35 2011
This archive was generated by hypermail 2.1.8 : Mon Nov 14 2011 - 10:41:55 MST