Skip to content

Commit 9facbfd

Browse files
Merge pull request #13 from waqasm78/master
Added String Compare articles
2 parents 664129a + edfca93 commit 9facbfd

28 files changed

+1296
-6
lines changed
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+
```
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# String_Contains
2+
3+
`String_Contains` returns a value indicating whether a specified substring occurs within this string.
4+
5+
```csharp
6+
String_Contains (
7+
@source NVARCHAR (MAX),
8+
@target NVARCHAR (MAX)
9+
)
10+
RETURNS BIT
11+
```
12+
13+
## Parameters
14+
15+
- **source**: The source string.
16+
- **target**: The string to search within source string.
17+
18+
## Returns
19+
20+
`true` if the target parameter occurs within the source string, or if target is the empty string (""); otherwise, `false`.
21+
22+
## Example
23+
24+
```csharp
25+
SELECT SQLNET::String_Contains('This is a string.', 'string')
26+
```
27+
28+
# String_Contains4k
29+
30+
It is equivalent to `String_Contains` except no NVARCHAR(MAX) parameters; it can be used when input data will never be over 4000 characters as this function offers better performance.
31+
32+
```csharp
33+
String_Contains4k (
34+
@source NVARCHAR (4000),
35+
@target NVARCHAR (4000)
36+
)
37+
RETURNS BIT
38+
```
39+
40+
## Example
41+
42+
```csharp
43+
SELECT SQLNET::String_Contains4k('This is a string.', 'string')
44+
```
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# String_EndsWith
2+
3+
`String_EndsWith` determines whether the end of the source string instance matches a target string.
4+
5+
```csharp
6+
String_EndsWith (
7+
@source NVARCHAR (MAX),
8+
@target NVARCHAR (MAX)
9+
)
10+
RETURNS BIT
11+
```
12+
13+
## Parameters
14+
15+
- **source**: The source string.
16+
- **target**: The string to compare to the substring at the end of the source string.
17+
18+
## Returns
19+
20+
`true` if the target matches the end of the source string; otherwise, `false`.
21+
22+
## Example
23+
24+
```csharp
25+
SELECT SQLNET::String_EndsWith('This is a string.', 'string.')
26+
```
27+
28+
# String_EndsWith4k
29+
30+
It is equivalent to `String_EndsWith` except no NVARCHAR(MAX) parameters; it can be used when input data will never be over 4000 characters as this function offers better performance.
31+
32+
```csharp
33+
String_EndsWith4k (
34+
@source NVARCHAR (4000),
35+
@target NVARCHAR (4000)
36+
)
37+
RETURNS BIT
38+
```
39+
40+
## Example
41+
42+
```csharp
43+
SELECT SQLNET::String_EndsWith4k('This is a string.', 'string.')
44+
```
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# String_IndexOfCurrentCultureIgnoreCase
2+
3+
`String_IndexOfCurrentCultureIgnoreCase` returns the zero-based index of the first occurrence of a `searchValue` Unicode character or string within the `source` string using culture-sensitive sort rules, the current culture, and ignoring the case of the strings.
4+
5+
```csharp
6+
String_IndexOfCurrentCultureIgnoreCase (
7+
@source NVARCHAR (MAX),
8+
@searchValue NVARCHAR (MAX)
9+
)
10+
RETURNS INT
11+
```
12+
13+
## Parameters
14+
15+
- **source**: The source string.
16+
- **searchValue**: The string to search within the source string.
17+
18+
## Returns
19+
20+
The zero-based index position of the `searchValue` parameter from the start of the `source` string if that string is found, or -1 if it is not. If `searchValue` is Empty, the return value is 0.
21+
22+
## Example
23+
24+
```csharp
25+
SELECT SQLNET::String_IndexOfCurrentCultureIgnoreCase('This is a string.', 'string')
26+
SELECT SQLNET::String_IndexOfCurrentCultureIgnoreCase('Archæology', 'Æ')
27+
```
28+
29+
# String_IndexOfCurrentCultureIgnoreCase4k
30+
31+
It is equivalent to `String_IndexOfCurrentCultureIgnoreCase` except no NVARCHAR(MAX) parameters; it can be used when input data will never be over 4000 characters as this function offers better performance.
32+
33+
```csharp
34+
String_IndexOfCurrentCultureIgnoreCase4k (
35+
@source NVARCHAR (4000),
36+
@searchValue NVARCHAR (4000)
37+
)
38+
RETURNS INT
39+
```
40+
41+
## Example
42+
43+
```csharp
44+
SELECT SQLNET::String_IndexOfCurrentCultureIgnoreCase4k('This is a string.', 'string')
45+
SELECT SQLNET::String_IndexOfCurrentCultureIgnoreCase4k('Archæology', 'Æ')
46+
```
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# String_IndexOfCurrentCulture
2+
3+
`String_IndexOfCurrentCulture` returns the zero-based index of the first occurrence of a `searchValue` Unicode character or string within the `source` string using culture-sensitive sort rules and the current culture.
4+
5+
```csharp
6+
String_IndexOfCurrentCulture (
7+
@source NVARCHAR (MAX),
8+
@searchValue NVARCHAR (MAX)
9+
)
10+
RETURNS INT
11+
```
12+
13+
## Parameters
14+
15+
- **source**: The source string.
16+
- **searchValue**: The string to search within the source string.
17+
18+
## Returns
19+
20+
The zero-based index position of the `searchValue` parameter from the start of the `source` string if that string is found, or -1 if it is not. If `searchValue` is Empty, the return value is 0.
21+
22+
## Example
23+
24+
```csharp
25+
SELECT SQLNET::String_IndexOfCurrentCulture('This is a string.', 'string')
26+
SELECT SQLNET::String_IndexOfCurrentCulture('Archæology', 'Æ')
27+
```
28+
29+
# String_IndexOfCurrentCulture4k
30+
31+
It is equivalent to `String_IndexOfCurrentCulture` except no NVARCHAR(MAX) parameters; it can be used when input data will never be over 4000 characters as this function offers better performance.
32+
33+
```csharp
34+
String_IndexOfCurrentCulture4k (
35+
@source NVARCHAR (4000),
36+
@searchValue NVARCHAR (4000)
37+
)
38+
RETURNS INT
39+
```
40+
41+
## Example
42+
43+
```csharp
44+
SELECT SQLNET::String_IndexOfCurrentCulture4k('This is a string.', 'string')
45+
SELECT SQLNET::String_IndexOfCurrentCulture4k('Archæology', 'Æ')
46+
```
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# String_IndexOfInvariantCultureIgnoreCase
2+
3+
`String_IndexOfInvariantCultureIgnoreCase` returns the zero-based index of the first occurrence of a `searchValue` Unicode character or string within the `source` string using culture-sensitive sort rules, the invariant culture, and ignoring the case of the strings.
4+
5+
```csharp
6+
String_IndexOfInvariantCultureIgnoreCase (
7+
@source NVARCHAR (MAX),
8+
@searchValue NVARCHAR (MAX)
9+
)
10+
RETURNS INT
11+
```
12+
13+
## Parameters
14+
15+
- **source**: The source string.
16+
- **searchValue**: The string to search within the source string.
17+
18+
## Returns
19+
20+
The zero-based index position of the `searchValue` parameter from the start of the `source` string if that string is found, or -1 if it is not. If `searchValue` is Empty, the return value is 0.
21+
22+
## Example
23+
24+
```csharp
25+
SELECT SQLNET::String_IndexOfInvariantCultureIgnoreCase('This is a string.', 'string')
26+
SELECT SQLNET::String_IndexOfInvariantCultureIgnoreCase('Archæology', 'Æ')
27+
```
28+
29+
# String_IndexOfInvariantCultureIgnoreCase4k
30+
31+
It is equivalent to `String_IndexOfInvariantCultureIgnoreCase` except no NVARCHAR(MAX) parameters; it can be used when input data will never be over 4000 characters as this function offers better performance.
32+
33+
```csharp
34+
String_IndexOfInvariantCultureIgnoreCase4k (
35+
@source NVARCHAR (4000),
36+
@searchValue NVARCHAR (4000)
37+
)
38+
RETURNS INT
39+
```
40+
41+
## Example
42+
43+
```csharp
44+
SELECT SQLNET::String_IndexOfInvariantCultureIgnoreCase4k('This is a string.', 'string')
45+
SELECT SQLNET::String_IndexOfInvariantCultureIgnoreCase4k('Archæology', 'Æ')
46+
```

0 commit comments

Comments
 (0)