Copy a part of a string
strncpy(s1{}, const s2{}, len=sizeof(s1), ofs=0
Copy a substring.
s1 | Destination |
s2 | Source string |
len | Max number of characters to compare |
ofs | Starting offset in s2 |
Returns the number of bytes copied
new mystring{} = "This is a test";
new s{80}, x;
x = strncpy(s, mystring, 3, 1);
// x = 3, s = "his"