Case-independent string comparison. It works with this dataset: 'aáäàâbcdeéëèêfghiíïìîjklmnñoóöòôpqrstuúüùûvwxyz'
l = cistrcmp(str1, str2)
Where:
str1
: First string to compare.str2
: Second string to compare.It returns True if both strings are equal independently of the case and False otherwise.
The following program performs a case-independent string comparison:
PROGRAM cistrcmpExample
USE FU_Strings, ONLY: cistrcmp
IMPLICIT NONE
CHARACTER(LEN=:), ALLOCATABLE :: text1, text2
text1 = 'String1'
text2 = 'string1'
IF (cistrcmp(text1, text2)) THEN
WRITE(*,*) 'Both strings are equal'
ELSE
WRITE(*,*) 'Both strings are not equal'
END IF
END PROGRAM cistrcmpExample
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | str1 |
First string to compare. |
||
character(len=*), | intent(in) | :: | str2 |
Second string to compare |
True if both strings are equal independently of the case. False otherwise.