"insert" (string::insert)
Inserts the string s at the given index pos.
Synopsis
int string.insert(int pos, string s);
Parameters
| Parameter | Description |
|---|---|
| pos | Position on which s should be inserted. |
| s | String to be inserted. |
Description
Inserts the string s at the given index pos.
If pos is negative or larger than length(), the return value is -1, else always 0.
Example
main()
{
string s = "WinCC OA";
DebugN(s.insert(5, " Open"));
DebugN(s);
}
Console output:
WCCOAui1:["0"]
WCCOAui1:["WinCC Open OA"]
Assignment
String
