You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`String_Insert` returns a new string in which a `value` string is inserted at a specified index position in the `source` string.
4
+
5
+
```csharp
6
+
String_Insert (
7
+
@sourceNVARCHAR (MAX),
8
+
@startIndexINT,
9
+
@valueNVARCHAR (MAX)
10
+
)
11
+
RETURNSNVARCHAR (MAX)
12
+
```
13
+
14
+
## Parameters
15
+
16
+
-**source**: The source string.
17
+
-**startIndex**: The zero-based index position of the insertion.
18
+
-**value**: The string to insert.
19
+
20
+
## Returns
21
+
22
+
A new string that is equivalent to the `source` string, but with `value` inserted at position `startIndex`.
23
+
24
+
## Example
25
+
26
+
```csharp
27
+
SELECTSQLNET::String_Insert('This is a string.', 10, 'new ')
28
+
SELECTSQLNET::String_Insert('aaaabbbb', 4, ' ')
29
+
```
30
+
31
+
# String_Insert4k
32
+
33
+
It is equivalent to `String_Insert` except no NVARCHAR(MAX) parameters; it can be used when input data will never be over 4000 characters as this function offers better performance.
34
+
35
+
```csharp
36
+
String_Insert4k (
37
+
@sourceNVARCHAR (4000),
38
+
@startIndexINT,
39
+
@valueNVARCHAR (4000)
40
+
)
41
+
RETURNSNVARCHAR (4000)
42
+
```
43
+
44
+
## Example
45
+
46
+
```csharp
47
+
SELECTSQLNET::String_Insert4k('This is a string.', 10, 'new ')
0 commit comments