View previous topic :: View next topic |
Author |
Message |
Little-Acorn
Joined: 06 Jul 2008 Posts: 111 Location: San Diego
|
Posted: Fri Nov 30, 2012 9:12 pm Post subject: How to pick a shorter substring out of a long string in SCC? |
|
|
If I have a string in a variable cline, 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 str easily enough, in the HELP section for SCC. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8255 Location: Salford, UK
|
Posted: Fri Nov 30, 2012 11:31 pm Post subject: |
|
|
strncpy |
|
Back to top |
|
 |
Little-Acorn
Joined: 06 Jul 2008 Posts: 111 Location: San Diego
|
Posted: Sat Dec 01, 2012 2:32 am Post subject: |
|
|
strncpy takes the FIRST characters found in a string, not characters from somewhere in the middle of the string, correct? |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8255 Location: Salford, UK
|
Posted: Sat Dec 01, 2012 9:39 am Post subject: |
|
|
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. |
|
Back to top |
|
 |
|