Silverfrost Forums

Welcome to our forums

How to pick a shorter substring out of a long string in SCC?

30 Nov 2012 8:12 #11212

If I have a string in a variable [u:df96ee5a3a]cline[/u:df96ee5a3a], whose value is 'Now is the time for all good men', is there a way I can assign characters 7 thru 18 into another string variable, so the new (shorter) variable gets the value 'the time for' ?

Is there a place where such functions are documented? I've found the functions whose names start with [u:df96ee5a3a]str[/u:df96ee5a3a] easily enough, in the HELP section for SCC.

30 Nov 2012 10:31 #11216

strncpy

1 Dec 2012 1:32 #11221

[u:794fd2938e]strncpy[/u:794fd2938e] takes the FIRST characters found in a string, not characters from somewhere in the middle of the string, correct?

1 Dec 2012 8:39 #11223

You can add an integer offset to the char* pointer in order to point to the first position from which to copy.

This will have to be my last post on this subject. This is not really the place to get help with elementary programming.

Please login to reply.