You are viewing an older version of the site. Click here to view
the latest version of this page. (This may be a dead link, if so, try the root page of the docs
here.)
== string_compare_ic ==
Copy Code
The output would be:
Copy Code
The output would be:
Copy Code
The output would be:
Copy Code
The output would be:
Copy Code
The output would be:
Copy Code
The output would be:
Compares two strings lexicographically ignoring casing. The comparison is based on the Unicode value of each character in the strings. Returns 0 if s1 is equal to s2, a negative value if s1 is lexographically less than s2, and a positive value if s1 is lexigraphically greater than s2. The magnitude of non-zero return values is the difference between the char values at the first index at which a different char was found in both strings. If all chars match but the strings differ in length, then the magnitude is this difference.
=== Vital Info ===
{| style="width: 40%;" cellspacing="1" cellpadding="1" border="1" class="wikitable"
|-
! scope="col" width="20%" |
! scope="col" width="80%" |
|-
! scope="row" | Name
| string_compare_ic
|-
! scope="row" | Returns
| int
|-
! scope="row" | Usages
| string s1, string s2
|-
! scope="row" | Throws
|
|-
! scope="row" | Since
| 3.3.5
|-
! scope="row" | Restricted
| No
|-
! scope="row" | Optimizations
| None
|}
=== Usages ===
string_compare_ic(string s1, string s2)=== Examples === ====Example 1==== Given the following code:
string_compare_ic('axx', 'bxx')

1 {{function|string_compare_ic}}('axx', 'bxx')
:-1====Example 2==== Given the following code:
string_compare_ic('Axx', 'bxx')

1 {{function|string_compare_ic}}('Axx', 'bxx')
:-1====Example 3==== Given the following code:
string_compare_ic('axx', 'Bxx')

1 {{function|string_compare_ic}}('axx', 'Bxx')
:-1====Example 4==== Given the following code:
string_compare_ic('xbx', 'xax')

1 {{function|string_compare_ic}}('xbx', 'xax')
:1====Example 5==== Given the following code:
string_compare_ic('abc', 'abc')

1 {{function|string_compare_ic}}('abc', 'abc')
:0====Example 6==== Given the following code:
string_compare_ic('abc', 'abcde')

1 {{function|string_compare_ic}}('abc', 'abcde')
:-2
Find a bug in this page? Edit this page yourself, then submit a pull request. (Note this page is automatically generated from the documentation in the source code.)