Skip to content

Commit 335bb33

Browse files
committed
Added String Compare articles
1 parent 3324ee8 commit 335bb33

4 files changed

Lines changed: 164 additions & 5 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# String_CompareInvariantCultureIgnoreCase
2+
3+
`String_CompareInvariantCultureIgnoreCase` compares two specified String objects using culture-sensitive sort rules, the invariant culture, and ignoring the case of the strings, and returns an integer that indicates their relative position in the sort order.
4+
5+
```csharp
6+
String_CompareInvariantCultureIgnoreCase (
7+
@strA NVARCHAR (MAX),
8+
@strB NVARCHAR (MAX)
9+
)
10+
RETURNS INT
11+
```
12+
13+
## Parameters
14+
15+
- **strA**: The first string to compare.
16+
- **strB**: The second string to compare.
17+
18+
## Returns
19+
20+
A 32-bit signed integer that indicates the lexical relationship between the two comparands.
21+
22+
| Value | Condition |
23+
|:--------- |:--------- |
24+
|Less than zero |strA precedes strB in the sort order.|
25+
|Zero |strA occurs in the same position as strB in the sort order.|
26+
|Greater than zero |strA follows strB in the sort order.|
27+
28+
## Example
29+
30+
```csharp
31+
SELECT SQLNET::String_CompareInvariantCultureIgnoreCase('case', 'Case')
32+
SELECT SQLNET::String_CompareInvariantCultureIgnoreCase('encyclopædia', 'encyclopaedia')
33+
```
34+
35+
# String_CompareInvariantCultureIgnoreCase4k
36+
37+
It is equivalent to `String_CompareInvariantCultureIgnoreCase` except no NVARCHAR(MAX) parameters; it can be used when input data will never be over 4000 characters as this function offers better performance.
38+
39+
```csharp
40+
String_CompareInvariantCultureIgnoreCase4k (
41+
@strA NVARCHAR (4000),
42+
@strB NVARCHAR (4000)
43+
)
44+
RETURNS INT
45+
```
46+
47+
## Example
48+
49+
```csharp
50+
SELECT SQLNET::String_CompareInvariantCultureIgnoreCase4k('case', 'Case')
51+
SELECT SQLNET::String_CompareInvariantCultureIgnoreCase4k('encyclopædia', 'encyclopaedia')
52+
```
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# String_CompareOrdinalIgnoreCase
2+
3+
`String_CompareOrdinalIgnoreCase` compares two specified String objects using ordinal (binary) sort rules and ignoring the case of the strings, and returns an integer that indicates their relative position in the sort order.
4+
5+
```csharp
6+
String_CompareOrdinalIgnoreCase (
7+
@strA NVARCHAR (MAX),
8+
@strB NVARCHAR (MAX)
9+
)
10+
RETURNS INT
11+
```
12+
13+
## Parameters
14+
15+
- **strA**: The first string to compare.
16+
- **strB**: The second string to compare.
17+
18+
## Returns
19+
20+
A 32-bit signed integer that indicates the lexical relationship between the two comparands.
21+
22+
| Value | Condition |
23+
|:--------- |:--------- |
24+
|Less than zero |strA precedes strB in the sort order.|
25+
|Zero |strA occurs in the same position as strB in the sort order.|
26+
|Greater than zero |strA follows strB in the sort order.|
27+
28+
## Example
29+
30+
```csharp
31+
SELECT SQLNET::String_CompareOrdinalIgnoreCase('case', 'Case')
32+
SELECT SQLNET::String_CompareOrdinalIgnoreCase('Archæology', 'ARCHÆOLOGY')
33+
```
34+
35+
# String_CompareOrdinalIgnoreCase4k
36+
37+
It is equivalent to `String_CompareOrdinalIgnoreCase` except no NVARCHAR(MAX) parameters; it can be used when input data will never be over 4000 characters as this function offers better performance.
38+
39+
```csharp
40+
String_CompareOrdinalIgnoreCase4k (
41+
@strA NVARCHAR (4000),
42+
@strB NVARCHAR (4000)
43+
)
44+
RETURNS INT
45+
```
46+
47+
## Example
48+
49+
```csharp
50+
SELECT SQLNET::String_CompareOrdinalIgnoreCase4k('case', 'Case')
51+
SELECT SQLNET::String_CompareOrdinalIgnoreCase4k('Archæology', 'ARCHÆOLOGY')
52+
```
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# String_CompareOrdinal
2+
3+
`String_CompareOrdinal` compares two specified String objects using ordinal (binary) sort rules, and returns an integer that indicates their relative position in the sort order.
4+
5+
```csharp
6+
String_CompareOrdinal (
7+
@strA NVARCHAR (MAX),
8+
@strB NVARCHAR (MAX)
9+
)
10+
RETURNS INT
11+
```
12+
13+
## Parameters
14+
15+
- **strA**: The first string to compare.
16+
- **strB**: The second string to compare.
17+
18+
## Returns
19+
20+
A 32-bit signed integer that indicates the lexical relationship between the two comparands.
21+
22+
| Value | Condition |
23+
|:--------- |:--------- |
24+
|Less than zero |strA precedes strB in the sort order.|
25+
|Zero |strA occurs in the same position as strB in the sort order.|
26+
|Greater than zero |strA follows strB in the sort order.|
27+
28+
## Example
29+
30+
```csharp
31+
SELECT SQLNET::String_CompareOrdinal('case', 'Case')
32+
SELECT SQLNET::String_CompareOrdinal('Archæology', 'ARCHÆOLOGY')
33+
```
34+
35+
# String_CompareOrdinal4k
36+
37+
It is equivalent to `String_CompareOrdinal` except no NVARCHAR(MAX) parameters; it can be used when input data will never be over 4000 characters as this function offers better performance.
38+
39+
```csharp
40+
String_CompareOrdinal4k (
41+
@strA NVARCHAR (4000),
42+
@strB NVARCHAR (4000)
43+
)
44+
RETURNS INT
45+
```
46+
47+
## Example
48+
49+
```csharp
50+
SELECT SQLNET::String_CompareOrdinal4k('case', 'Case')
51+
SELECT SQLNET::String_CompareOrdinal4k('Archæology', 'ARCHÆOLOGY')
52+
```

docs2/pages/documentations/string/string.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ Represents text as a sequence of UTF-16 code units.
55

66
| Name | Description | Example |
77
| :--- | :---------- | :------ |
8-
| [String_Compare](/string-compare) | Compares two specified String objects. | [Try it]()|
9-
| [String_CompareCurrentCulture](/string-compare-current-culture) | Compares two specified String objects using culture-sensitive sort rules and the current culture. | [Try it]()|
10-
| [String_CompareCurrentCultureIgnoreCase](/string-compare-current-culture-ignore-case) | Compares two specified String objects using culture-sensitive sort rules, the current culture, and ignoring the case of the strings. | [Try it]()|
11-
| [String_CompareIgnoreCase](/string-compare-ignore-case) | Compares two specified String objects ignoring their case. | [Try it]()|
12-
| [String_CompareInvariantCulture](/string-compare-invariant-culture) | Compares two specified String objects using culture-sensitive sort rules and the invariant culture. | [Try it]()|
8+
| [String_Compare(strA, strB)](/string-compare) | Compares two specified String objects. | [Try it]()|
9+
| [String_CompareCurrentCulture(strA, strB)](/string-compare-current-culture) | Compares two specified String objects using culture-sensitive sort rules and the current culture. | [Try it]()|
10+
| [String_CompareCurrentCultureIgnoreCase(strA, strB)](/string-compare-current-culture-ignore-case) | Compares two specified String objects using culture-sensitive sort rules, the current culture, and ignoring the case of the strings. | [Try it]()|
11+
| [String_CompareIgnoreCase(strA, strB)](/string-compare-ignore-case) | Compares two specified String objects ignoring their case. | [Try it]()|
12+
| [String_CompareInvariantCulture(strA, strB)](/string-compare-invariant-culture) | Compares two specified String objects using culture-sensitive sort rules and the invariant culture. | [Try it]()|
13+
| [String_CompareInvariantCultureIgnoreCase(strA, strB)](/string-compare-invariant-culture-ignore-case) | Compares two specified String objects using culture-sensitive sort rules, the invariant culture, and ignoring the case of the strings. | [Try it]()|
14+
| [String_CompareOrdinal(strA, strB)](/string-compare-ordinal) | Compares two specified String objects using ordinal (binary) sort rules. | [Try it]()|
15+
| [String_CompareOrdinalIgnoreCase(strA, strB)](/string-compare-ordinal-ignore-case) | Compares two specified String objects using ordinal (binary) sort rules, and ignoring the case of the strings. | [Try it]()|

0 commit comments

Comments
 (0)