| Author |
Comparing characters ignoring case
|
|
| smokesingdance 2005-09-11, 7:56 am |
| Is it possible in Fortran to compare characters, character strings and
character arrays whiloe ignoring case such that the statements
('a'.EQ.'A') and ('strUING'.EQ.'STruInG') are true?
| |
| David Frank 2005-09-11, 7:56 am |
|
"smokesingdance" <smokesingdance@aol.com> wrote in message
news:1126431121.016473.321670@g47g2000cwa.googlegroups.com...
> Is it possible in Fortran to compare characters, character strings and
> character arrays whiloe ignoring case such that the statements
> ('a'.EQ.'A') and ('strUING'.EQ.'STruInG') are true?
>
IF ('a' == Lower('A')) THEN
IF (Upper('strUING') == Upper('STruInG')) THEN
IF (Upper(string1) == Upper(string2)) THEN leaving string1,2 undisturbed
As a result of your inquiry I have added Upper/Lower functions to
http://home.earthlink.net/~dave_gemini/strings.f90
| |
| Richard Maine 2005-09-11, 7:56 am |
| In article <1126431121.016473.321670@g47g2000cwa.googlegroups.com>,
"smokesingdance" <smokesingdance@aol.com> wrote:
> Is it possible in Fortran to compare characters, character strings and
> character arrays whiloe ignoring case such that the statements
> ('a'.EQ.'A') and ('strUING'.EQ.'STruInG') are true?
Nothing in the standard, but it is simple enough to write your own
functions to do such comparison (at least if you want just the 26 Arabic
letters handled - life gets a bit harder with other character sets).
| |
| Edward N Bromhead 2005-09-11, 6:57 pm |
|
"Richard Maine" <nospam@see.signature> wrote in message
news:nospam-1D5098.04170711092005@news.supernews.com...
> In article <1126431121.016473.321670@g47g2000cwa.googlegroups.com>,
> "smokesingdance" <smokesingdance@aol.com> wrote:
>
>
> Nothing in the standard, but it is simple enough to write your own
> functions to do such comparison (at least if you want just the 26 Arabic
> letters handled - life gets a bit harder with other character sets).
ARABIC letters? - now that IS rewriting history!
E.
| |
| Richard Maine 2005-09-11, 6:57 pm |
| In article <dg1g1i$sc5$1@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com>,
"Edward N Bromhead" <edward.bromhead@deletethisbitbinternet.com>
wrote:
> ARABIC letters? - now that IS rewriting history!
Oops. Well, letters, numbers, something like that. One of them was
arabic. :-)
| |
| David Flower 2005-09-12, 3:56 am |
|
David Frank wrote:
> "smokesingdance" <smokesingdance@aol.com> wrote in message
> news:1126431121.016473.321670@g47g2000cwa.googlegroups.com...
>
> IF ('a' == Lower('A')) THEN
>
> IF (Upper('strUING') == Upper('STruInG')) THEN
>
> IF (Upper(string1) == Upper(string2)) THEN leaving string1,2 undisturbed
>
> As a result of your inquiry I have added Upper/Lower functions to
>
> http://home.earthlink.net/~dave_gemini/strings.f90
Does it handle the extended character set ?
i.e. Is <upper case C cedilla> equal to <lower case C cedilla?>
Dave Flower
| |
| Arjen Markus 2005-09-12, 3:56 am |
| Latin letters and Arabic digits ... and I think the zero is of Indian
origin ...
Yes, there is a lot of history there
Regards,
Arjen
|
|
|
|